View Full Version : Simple Query giving error message... help please?


killyridols
07-20-2009, 10:09 AM
Hi,

When I try to run this simple query:

SELECT sample_id, sum(data) AS summe
FROM REVDAT;

I get an error message that says,
"You tried to execute a query that does not include the specified expression 'sample_id' as part of an aggregate function"

Does anyone know what would cause this error?
I have no idea....

Thank you!

ByteMyzer
07-20-2009, 10:12 AM
You need to include a GROUP BY clause, thus:

SELECT sample_id, sum(data) AS summe
FROM REVDAT
GROUP BY sample_id;

killyridols
07-20-2009, 10:16 AM
thanks, ya sorry, I ended up realizing that right after i posted that.
Sorry for taking up unnecessary space on the board!