Say I have an sql query that returns the following data:
USERID, LOCATIONID, SITE
usera, locationa, site1
userb, locationb, site1
userx, locationx, site1
userc, locationc, site2
I only care about unique SITE, so I would like the query to return:
USERID, LOCATIONID, SITE
usera, locationa, site1
userc, locationc, site2
How can I modify:
select userid, locationid, site from mytable order by site;
To accomplish this?