WHAT IS USE OF COALESCE KEYWORD

step 1:

CREATE TABLE COLLEGE(SID NVARCHAR(10),SNAME NVARCHAR(20),PLACE NVARCHAR(20))

Step 2:

INSERT INTO COLLEGE VALUES(1,'SURESH',NULL),(NULL,'RAMESH','PUDUKKOTTAI'),(3,'RAMU','COIMBATORE')

-- ABOVE QUERY WILL RUN ONLY SQL 2008,2012

STEP 3:

SELECT COALESCE(SID,SNAME,PLACE) AS 'STUDNAME' FROM COLLEGE

STEP 4:

Post your Ans http://jssql.blogspot.in/







1 comment:

  1. sir this is the answer sir
    1
    RAMESH
    3

    but y it takes 3ed value as 3 sir?

    ReplyDelete

Featured Post

MSDEVBUILD in Feedspot Top 100 Microsoft Azure Blogs

I am pleased to announce my blog msdevbuild.com again has been listed on the popular Feedspot website as one of the Top 100 Microsoft Azure...

Popular Posts