Coalesce is also available in Sybase
This functions evaluates the listed expressions and returns the first non-null value. If all the expressions are null, coalesce returns null
USAGE: coalesce(expression, expression [, expression]...)
Returns the first occurrence of a non-NULL value in either the initialqty or finalqty or middleqty
CREATE TABLE #TMP_COL(
INSERT INTO #TMP_COL VALUES ('NULL','NULL','55555')
Select Coalesce (Office_phno, mobile_nos, home_phnos) as ContactNo FROM #TMP_COL
Posted by: Rajesh
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
There should not be any Spelling Mistakes.
There should not be any Gramatical Errors.
Answers must not contain any bad words.
Answers should not be the repeat of same answer, already approved.
Answer should be complete in itself.