-
Group By
I'm trying to run this statement:
select ppn_i,cpn_i,bomcat_i from tbi..bm010115
where ppn_i = 'BDS-2570'
group by bomcat_i
and was getting this error:
Server: Msg 8120, Level 16, State 1, Line 1
Column 'tbi..bm010115.PPN_I' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.
-
When GROUP BY is specified, either each column in any non-aggregate expression in the select list should be included in the GROUP BY list, or the GROUP BY expression must match exactly the select list expression.
-
finally figured it out. i was using the wrong statement, it was ORDER BY but I was curious with your post. can give me a sample statement utilizing GROUP BY. Thanks.
-
You can find samples in books online.
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
|
|