|
-
Dec 26th, 2004, 04:43 PM
#9
Re: group by
When you use GROUP BY you must GROUP BY each and every field that is in the SELECT statement...
Or...
Put the field in the SELECT statement within an AGGREGATE function - such as SUM, MAX, MIN...
So you can say:
SELECT STATUS,SUM(1) FROM TABLEX GROUP BY STATUS
or SELECT STATUS,MAX(SOMEDATEFIELD) FROM TABLEX GROUP BY STATUS
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
|