SELECT duplicate records from table
Submitted by inder on Sat, 10/01/2009 - 23:01.
You can use SELECT command for performaing single as well as complax operations depending on requirements.Belo is a simple use of SQL statement for getting duplicate records from database table:-
SELECT *
FROM `<table>`
WHERE <key>
IN (
SELECT <key>
FROM <table>
GROUP BY <key>
HAVING count( * ) >1
)
Example:-
SELECT *
FROM `demo`
WHERE id
IN (
SELECT id
FROM demo
GROUP BY id
HAVING count( * ) >1
)
- Printer-friendly version
- Login or register to post comments
Delicious
Digg
StumbleUpon
Facebook
Google
Yahoo
Technorati
Icerocket

Sign In





