Monday, February 13, 2012

How to check Null or not ?

Select coalesce(A.FirstName,'')+' '+ coalesce(A.MiddleName,'')+' '+ coalesce(A.LastName,'') As StudentName, A.studentID,  From studentInfo As A

Other
-----------
Select A.FirstName+space(1)+isnull(A.MiddleName,'')+space(1)+isnull(A.LastName,'') As StudentName ,A.RollNumber From studentInfo As A

No comments:

Post a Comment