Simple Query giving error message... help please? (1 Viewer)

killyridols

Registered User.
Local time
Yesterday, 16:59
Joined
Jul 16, 2009
Messages
22
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

AWF VIP
Local time
Yesterday, 16:59
Joined
May 3, 2004
Messages
1,409
You need to include a GROUP BY clause, thus:
Code:
SELECT sample_id, sum(data) AS summe
FROM REVDAT
[B][I][COLOR=red]GROUP BY sample_id[/COLOR][/I][/B];
 

killyridols

Registered User.
Local time
Yesterday, 16:59
Joined
Jul 16, 2009
Messages
22
thanks, ya sorry, I ended up realizing that right after i posted that.
Sorry for taking up unnecessary space on the board!
 

Users who are viewing this thread

Top Bottom