Hi,
Anyone have a really good reference for learning group by/having clauses in
sql? I'm having real trouble getting my head around them.
I can run a query with say, 2 columns, grouping by one and using count() in
the other, but whenever I add another column it says it's not part of an
aggregate function. I don't think I want it to be but there must be another
way around it.
For example I can create this result.
Code Number
X 2
Y 2
Z 3
But now I want this result
ID Code Number
1 X 2
2 X 2
3 Y 2
4 Y 2
5 Z 3
6 Z 3
7 Z 3
Thanks in advance,
Chris