Reputation: 33
Let's say I had the following column:
+------+
| id |
+------+
|1500 |
|1500 |
|1600 |
|1700 |
|1700 |
|1700 |
|1800 |
+------+
My question is I want to display only the ids that shown in column once, how it can be done?
So the result will be 1600 & 1800
Upvotes: 0
Views: 48
Reputation: 21961
select id from tablename
group by id
Having Count(id) = 1
Upvotes: 0
Reputation: 39278
SELECT ID FROM YourTable
GROUP BY ID
Having Count(*) = 1
Try the above
Upvotes: 1