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

01-31-2005, 03: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 745856@usa.net....


mvpari :confused:

01-31-2005, 11:35 PM
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,... ?)

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