Sysmic Wave
07-23-2010, 09:24 AM
Hi folks, hope you can help.
Say I had a table like this.
ID | Name | Location
------------------------
1 | Peter | Scotland
2 | Ron | Wales
3 | Alan | Scotland
4 | John | Scotland
5 | Michael | Wales
6 | Ian | England
What i'm trying to do is get the totals of each location and order them in descending order. Bear with me as I confuse myself here.
So the output would be something like this:
Scotland 3
Wales 2
England 1
I know I could run a query and then get the recordcount but is there any SQL function that would allow me to return the data and sort descendingly.
Thanks for staying with me.
Say I had a table like this.
ID | Name | Location
------------------------
1 | Peter | Scotland
2 | Ron | Wales
3 | Alan | Scotland
4 | John | Scotland
5 | Michael | Wales
6 | Ian | England
What i'm trying to do is get the totals of each location and order them in descending order. Bear with me as I confuse myself here.
So the output would be something like this:
Scotland 3
Wales 2
England 1
I know I could run a query and then get the recordcount but is there any SQL function that would allow me to return the data and sort descendingly.
Thanks for staying with me.