show-notice
hide-notice

Saturday 10 August 2013

COALESCE Function In Sql Server


Introduction:

During Development we have use more time Colesce method If someone have home address or office address suppose if you dispaly available first record means you can use coalesce method or concatinate columns we use this coding

Table:

CREATE TABLE info
(
id int IDENTITY(1,1) NOT NULL,
name varchar(50), 
mobile varchar(50) ,
officephonen varchar(50) ,
homephoneno varchar(50) 
)
Query:
select name ,coalesce(mobile,officephonen,homephoneno)
PhoneNo from info
Output: 

SHARE THIS POST   

0 comments :

Post a Comment

Design by Gohilinfotech | www.gohilinfotech.blogspot.com