我在表上有2行
Device_ID Other_ID
======== ========
633 1
232 2
242 2
我需要以下结果:
Device_ID Other_ID
======== ========
633 1
232 2
如何在SQL中完成?
谢谢!
答案 0 :(得分:3)
SELECT min(Device_ID) AS Device_ID, Other_ID
FROM tbl
GROUP BY Other_ID
ORDER BY Other_ID;