View Full Version : Hi All new on this...need help!!!

Jan 31st, 2005, 04:32 PM
Hi all,

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]


mvpari :confused:

Feb 1st, 2005, 12:35 AM
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,... ?)

Feb 1st, 2005, 02:22 AM
Aren't you validating this before it's entered into the db?