delete from tablename where id not in ( select min(id) from tablename group by column1 , column2 ,column3)
example
DELETE FROM DAILY_ATTENDANCE
WHERE ATT_ID NOT IN
( SELECT MIN(ATT_ID)
FROM DAILY_ATTENDANCE
GROUP BY STAFF_ID, TIME_IN, TIME_OUT
)
IT tips
Comments
Post a Comment