user1723761
user1723761

Reputation: 33

How to get unique data from one column?

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

Answers (2)

Arunprasanth K V
Arunprasanth K V

Reputation: 21961

select id  from tablename
group by id
Having Count(id) = 1

Upvotes: 0

TGH
TGH

Reputation: 39278

SELECT ID FROM YourTable
GROUP BY ID 
Having Count(*) = 1

Try the above

Upvotes: 1

Related Questions