Reputation: 653
I have two columns(column1, column2) in my oracle database table named as demo. I want to select same column1 having different column2.
SQL> select * from demo;
column1 | column2
--------|--------
A | 10
A | 20
A | 30
A | 30
I want the following output with count(*)
:
column1 | column2
--------|--------
A | 10
A | 20
How can i do this? Any help is much appreciated
Upvotes: 4
Views: 127
Reputation:
Try:
select column1, column2
from myTable
group by column1, column2
having count(*) = 1
Upvotes: 2