Reply to MS SQL IF ELSE condition checking

Your name:

Reply:


Posted by Yas on 07/27/07 21:47

Hello,

I have Table1 with column Email, which has mail addresses in the
format 'useremailid@'. Few of these Email values are NULL where no
mail address was specified.

In my View1 I'm using SUBSTRING like... Left(Email,CHARINDEX('@',
Email)-1) AS EMAIL_NAME (to cut out the @ sign) FROM Table1 and get
just the usermailid

Anyway, what I would like to do is use the above to get all the
usermailids and have a condition that checks if Email field IS NULL
and if TRUE replaces it with blank value ''

So something like IF (Email IS NULL) THEN Email = ''

I've never really used IF ELSE in a query and would be gratefull if
someone could help me out. I don't want to leave out the NULL values
using WHERE Email is NOT NULL, I just want to convert them to an empty
string ''

Many thanks in advance :-)

Yas

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация