Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 double rows

Author  Topic 

dotboy
Starting Member

2 Posts

Posted - 2005-04-25 : 13:21:26
Hi i have a table imported from txt with 12 million rows
and i want the first columns to put her as a primary key but there are to many double rows does anyone can help me to make an sql query to find the double rows?

X002548
Not Just a Number

15586 Posts

Posted - 2005-04-25 : 13:24:24
SELECT Col1, Col2, COUNT(*) FROM table GROUP BY Col1, Col2 HAVING COUNT(*) > 1

Brett

8-)
Go to Top of Page

dotboy
Starting Member

2 Posts

Posted - 2005-04-25 : 13:39:53
OH its working ! thanx a lot Brett
Go to Top of Page
   

- Advertisement -