I tried this but it doesn't work. I want to find all the inputs which do not have a valid e-mail with an @ symbol
SELECT * FROM tblEmail
WHERE [email] <> '%@'
I tried this but it doesn't work. I want to find all the inputs which do not have a valid e-mail with an @ symbol
SELECT * FROM tblEmail
WHERE [email] <> '%@'
To fully validate an email address using mysql you should do:
SELECT *
FROM tblEmail
WHERE email NOT REGEXP '^[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$';
Your current query is searching for an @
symbol at the end of the text only. If you need to match anywhere within the text (which is the case for emails) I expect you need to use '%@%'
.
Hence your full query might look like
SELECT * FROM tblEmail Where [email] NOT LIKE '%@%'