I have a set of data and I have to use sql command to sort out the data and display the desired result.
Here is the data:
ID NAME CATEGORY
1 Jacobs Finance
2 Elaine Finance
3 Mark Finance
4 Margha Finance
5 Linds Accounting
6 Andrew Accounting
7 Anderson Accounting
8 Rox Marketing
9 Goldwin Marketing
10 Johnson Marketing
Here is my desired output:
Finance
1 Jacobs
2 Elaine
3 Mark
Accounting
5 Linds
6 Andrew
7 Anderson
Marketing
8 Rox
9 Goldwin
10 Johnson
I thought I have to use GROUP BY command to sort out the data but I couldn't do it.
So, now I need your help. Thanks.