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
 In Few tables we have duplicate data?

Author  Topic 

vinoth86
Starting Member

27 Posts

Posted - 2008-04-30 : 01:00:54
How to fetch that replicated records?


Anyone can share the query??

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-04-30 : 02:14:53
SELECT Col1
FROM Table1
GROUP BY Col1
HAVING COUNT(*) > 1



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

soorajtnpki
Posting Yak Master

231 Posts

Posted - 2008-04-30 : 02:30:56
hi
what u actually need?
do u want to show all duplicated records?

select * from table where id in(select max(id) from table group by col1,col2.. having count(*) >1)

col1,col2.. are the columns that has the possibility to occur duplicated ones.../or they are the duplicated fields..

ok,
thanks
Go to Top of Page
   

- Advertisement -