Skip to main content
Search
Search This Blog
PROGRAMMING ESSENTIALS
FOLKS, THIS BLOG CONTAINS ESSENTIAL UPDATES ABOUT CRITICAL SOURCE CODES AND CHALLENGING PROBLEMS.
Share
Get link
Facebook
X
Pinterest
Email
Other Apps
August 04, 2022
SQL To Remove Duplicate Rows
Consider Below table EMPLOYEE
Query:
DELETE
EMPLOYEE
WHERE
ROWID
IN
(
SELECT
EMP.ROWID
FROM
EMPLOYEE EMP,
(
SELECT MIN
(ROWID) MINROW, EMPNAME
FROM
EMPLOYEE
GROUP BY
EMPNAME
HAVING COUNT
(EMPNAME)>1) SUBQ
WHERE
EMP.ROWID>SUBQ.MINROW
AND
EMP.EMPNAME=SUBQ.EMPNAME
);
Result:
Comments
Popular Posts
November 05, 2009
Sample RMI Implementation In Java:
August 06, 2011
Binary Search Tree And Other Problems
Comments