Reputation: 5004
I have 2 Rows on a Table
Device_ID Other_ID
======== ========
633 1
232 2
242 2
I need the following results:
Device_ID Other_ID
======== ========
633 1
232 2
How can this be done in SQL?
Thanks!
Upvotes: 0
Views: 110
Reputation: 656471
SELECT min(Device_ID) AS Device_ID, Other_ID
FROM tbl
GROUP BY Other_ID
ORDER BY Other_ID;
Upvotes: 3