假设我有以下专栏:
+------+
| id |
+------+
|1500 |
|1500 |
|1600 |
|1700 |
|1700 |
|1700 |
|1800 |
+------+
我的问题是我只想显示列中显示的ID一次,怎么做?
结果将是1600& 1800
答案 0 :(得分:1)
SELECT ID FROM YourTable
GROUP BY ID
Having Count(*) = 1
试试上面的
答案 1 :(得分:0)
select id from tablename
group by id
Having Count(id) = 1