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
 General SQL Server Forums
 New to SQL Server Programming
 Finding Duplicate Rows?

Author  Topic 

ds12will
Starting Member

21 Posts

Posted - 2009-10-05 : 15:33:14
Hi I'M new!

I'm working with a very large database and I'm trying to pull back duplicate rows.

Here is the catch though. I want to pull back rows that are the same but don't include one column.

Reasoning: There are multiple rows that are exactly the same except for one column (the column contains 0,1,or 2) I'm trying to find those rows that are all the same except that row. Trying to consolidate them eventually..

Does that make sense?

rohitkumar
Constraint Violating Yak Guru

472 Posts

Posted - 2009-10-05 : 15:51:27
what did you try so far?
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2009-10-05 : 17:55:16
SELECT Col1, Col2, Col3, ect
FROM myTable
GROUP BY Col1, Col2, Col3, ect
HAVING COUNT(*) > 1

????

Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page
   

- Advertisement -