here is an image of itI am trying to work in SQL server just its easier to show it in excel.
i have two columns: cardnumber and comment.
If one cardnumber exists twice in my database and it has a row with a comment “corrected” and also exists with the comment “closed” then i need to delete the line with the comment “corrected”.
I have no idea how to manage it, i tried with exists but it does not work.
Thank you all.
I tried
SELECT
*
FROM TABLE1
WHERE EXISTS(SELECT CARDNUMBER, COMMENT FROM TABLE1 WHERE COMMENT IN (‘CORRECTED’, ‘CLOSED’)
But it does not work.