storemannequin
Board Regular
- Joined
- May 29, 2010
- Messages
- 108
The query produces this:
but I want to change the queried results to look like this (with a count of Years):
I have been looking all over the internet for a solution to this but I've only seen them for cases when another column in also involved for summing. How can this be done in SQL? Any help much appreciated, I am a newbie in SQL.
Code:
ID Year
101 2011
200 2012
184 2011
184 2013
133 2014
136 2011
189 2012
152 2013
129 2011
184 2013
136 2011
but I want to change the queried results to look like this (with a count of Years):
Code:
Year
ID 2011 2012 2013 2014
101 1
200 1
184 1 1
133 1
136 2
189 1
152 1
129 1
184 1
I have been looking all over the internet for a solution to this but I've only seen them for cases when another column in also involved for summing. How can this be done in SQL? Any help much appreciated, I am a newbie in SQL.