Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 qury changing values

Author  Topic 

esthera
Master Smack Fu Yak Hacker

1410 Posts

Posted - 2009-11-17 : 03:13:44
i have a query

select id,regname from new users

How can i seletct that if regname is blank or null then it should select 'processing' instead of blank.
is that possible with a case statement in the query?

sanoj_av
Posting Yak Master

118 Posts

Posted - 2009-11-17 : 03:50:43
select id,CASE WHEN regname IS NULL OR regname='' THEN 'Processing' ELSE regname END from new users
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-11-17 : 04:02:15
or


select id,CASE WHEN regname>''THEN regname ELSE 'Processing' END from new users


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

esthera
Master Smack Fu Yak Hacker

1410 Posts

Posted - 2009-11-17 : 04:26:37
thanks :)
Go to Top of Page
   

- Advertisement -