Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

doubles

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I wonder if there is an easy way to find doubles in a column.

I have a table that looks something like this:

12.34 aaaa
12.35 bbbb
12.35 cccc
12.36 dddd
12.37 eeee
12.38 ffff
12.38 gggg

and so on for a huge number of rows.

How can creat a new table with just the rows with doubles?
 
12.34 aaaa
12.35 bbbb
12.35 cccc
12.36 dddd
12.37 eeee
12.38 ffff
12.38 gggg

If col1 reflects doubles then you may try:

Select *
From Table1
Where col1 in (
select col1
from table1
group by col1
having count(*) > 1)

The subquery will return all the col1 values that exist more than once, and the outer query will select all the rows where col1 = the subquery columns.




AA 8~)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top