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)
 Runtime query checking

Author  Topic 

ersantosh1
Starting Member

6 Posts

Posted - 2012-03-26 : 03:19:27
Hi ,
can anybody help to check one of d content of sql query is null or not and it is null then instead of that content take another content.I have to that during query execution.

ex.

select Fname from mst_Data.

i want to do like if fname is null then it should take Lname of person

Thanks and regards.

santosh

srahangdale

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2012-03-26 : 03:28:47
[code]
select coalesce(Fname, Lname) from mst_Data
[/code]


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page
   

- Advertisement -