Home » SQL & PL/SQL » SQL & PL/SQL » help in simple sql statement
help in simple sql statement [message #19503] Fri, 22 March 2002 03:23 Go to next message
ksr
Messages: 112
Registered: January 2002
Senior Member
Hi,

i have a table tab1(col1 number,col2 number).

i have data like this
col1 col2
--------------------
1 1
1 2
2 2
2 3
1 1
1 2

Now i want to get only the records whose set is twice(means whose col1 and col2 combination values are same).

So i want output to be
col1 col2
---------------
1 1
1 2
Re: help in simple sql statement [message #19504 is a reply to message #19503] Fri, 22 March 2002 04:46 Go to previous message
Jon
Messages: 483
Registered: May 2001
Senior Member
select col1, col2
from table1
group by col1, col2
having count(*) > 1;
Previous Topic: Using query results in next query...is it possible?
Next Topic: DateTime Format
Goto Forum:
  


Current Time: Fri Apr 26 07:49:18 CDT 2024