|
-
Oct 8th, 1999, 09:23 AM
#1
Thread Starter
Member
Hi guys, Is there a way whereby i could select all the content in the table when using group by??
The code below works.
Select CLAIMNO, Format(sum(NET),'######0.00') from export_comp GROUP BY CLAIMNO order by CLAIMNO asc
But when I added (Vend_id & Clinic):
Select CLAIMNO, Vend_id, Clinic, Format(sum(NET),'######0.00') from export_comp GROUP BY CLAIMNO order by CLAIMNO asc
The following error message appears:
"You tried to execute a query that does not include specified expression as part of an aggregate function".
Thks & regards.
I know that i could actually include the other content by adding them into group by, but I did not want that, so is there another way out??
e.g.:
Select CLAIMNO, Vend_id, Clinic, Format(sum(NET),'######0.00') from export_comp GROUP BY CLAIMNO, Vend_id, Clinic order by CLAIMNO asc
[This message has been edited by SAMS (edited 10-08-1999).]
-
Oct 8th, 1999, 01:57 PM
#2
Frenzied Member
Not in SQL. When GROUP BY is used, the items in the select statement must either be an aggregate or referenced by the group by (in the case of non-aggregates).
-
Oct 10th, 1999, 08:15 AM
#3
Thread Starter
Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|