oracle sql - delete rows with null value for every group
I try to delete rows with null values at the mail column, if and only if exists a row with a non-null value for the same person_id. DELETE FROM EMP_MAIL EM WHERE MAIL IS NULL AND EXISTS ( SELECT EMP_ID FROM EMP_MAIL EM2 WHERE MAIL IS NOT NULL AND EM.EMP_ID = EM2.EMP_ID ) ; but it takes quite a while. (i have an non-unique index on EMP_MAIL(EMP_ID)) is there a better way to preform this operation ?
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.