Cannot get my head around the SQL that will return the number of times a user has accessed a particular service. Think it might require a nested count and select, but cannot get my head around it.
The data looks like this:
UserID Service
---------------
1 Map1
1 Map2
1 Map1
2 Map1
2 Map2
3 Map4
3 Map2
3 Map2
3 Map2
... ...
And the desired kind of output is something along the lines of this:
UserID Service TimesAccessed
------------------------------
1 Map1 2
1 Map2 1
2 Map1 1
2 Map2 1
3 Map3 3
3 Map4 1
... ... ...
Any help would be much appreciated.