Code:
SELECT sum06clients.name,SUM(bikoorim.nights) as totalnights FROM bikoorim INNER JOIN sum06clients on bikoorim.clientID = sum06clients.id GROUP BY bikoorim.clientID ORDER BY totalnights
"Select the [name] field from the customers table, and the sum of all the nights of this customer (by clientID) - call the sum of the nights: 'totalnights'.
Since the customers table and the visits (bikoorim) tables are seperated, join them by the connection: 'bikoorim.clientID = sum06clients.id'.
Organize all this sh*t by totalnights"
Too bad IIS can't understand MY English...

Can someone please help?
PS
the error is:
Code:
You tried to execute a query that does not include the specified expression 'name' as part of an aggregate function
Comment