Select Duplicate rows only
SELECT * FROM SB_TEST1 A
WHERE ROWID > (SELECT MIN(ROWID) FROM SB_TEST1 B
WHERE A.A=B.A)
SELECT *
FROM SB_TEST1
WHERE ROWID NOT IN (SELECT MAX(ROWID) FROM SB_TEST1 GROUP BY A)
Select all rows which considered having duplicate
SELECT *
FROM SB_TEST1
WHERE A IN (SELECT A FROM SB_TEST1
GROUP BY A HAVING COUNT (*) >1)
SELECT * FROM SB_TEST1 A
WHERE ROWID > (SELECT MIN(ROWID) FROM SB_TEST1 B
WHERE A.A=B.A)
SELECT *
FROM SB_TEST1
WHERE ROWID NOT IN (SELECT MAX(ROWID) FROM SB_TEST1 GROUP BY A)
Select all rows which considered having duplicate
SELECT *
FROM SB_TEST1
WHERE A IN (SELECT A FROM SB_TEST1
GROUP BY A HAVING COUNT (*) >1)
No comments:
Post a Comment