I have a list of e-mail addresses, some of them are in my table, some of them are not. I want to select all e-mails from that list and whether they are in the table or not.
I can get users whose mail adresses are in the table like this:
SELECT u.* FROM USERS u WHERE u.EMAIL IN ('email1', 'email2', 'email3')
But how can I select values in that list which are not exist in the table?
Moreover, how can I select like this:
E-Mail | Status
email1 | Exist
email2 | Exist
email3 | Not Exist
email4 | Exist