A quick question, I'm trying to identify relevant email addresses from a table. So far I've got the following in the where clause:
where email is not NULL
and email like ('%@%')
But does anyone know how I could get rid of spaces (if they occur) in the email field. For example 745856 @usa.net, should actually read as [email protected]
thanx
mvpari :confused:
Welcome here!
where email is not NULL and email like ('%@%')
should be
where email like ('%@%')
to get rid of the spaces --> depends on the db-format you use. For MySQL, that would be
SELECT REPLACE(email,' ','') AS email FROM yortablename WHERE email LIKE ('%@%')
but you could also do hthis in your server side language (PHP, ASP,... ?)
Aren't you validating this before it's entered into the db?