take example of below table where ID is PrimaryKey
ID | user | organization |
---|---|---|
1 | abc | xyz |
2 | def | uvw |
3 | abc | xyz |
4 | def | xyz |
5 | def | uvw |
I want to select from this table with DISTINCT values of user and organization along with the ID. So what I'm expecting is a result like one of the below. ie; either this
ID | user | organization |
---|---|---|
1 | abc | xyz |
2 | def | uvw |
4 | def | xyz |
or this
ID | user | organization |
---|---|---|
3 | abc | xyz |
5 | def | uvw |
4 | def | xyz |
How do I write a query for this ?