Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

COALESCE Function

Status
Not open for further replies.

ADB1

Programmer
Aug 24, 2001
235
GB
All,

Can someone explain how the COALESCE function works. I think it does the following, would I be correct?

COALESCE(Col1,Col2)

If Col2 is null use Col1....or is it the other way round?!

Thanks.

A.
 
It returns the first NOT NULL value from the string of attributes. Often used in place of non-ANCII Zeroifnull.

COALESCE(Col1,0) = return col1 if not NULL, 0 if NULL. Can contain more then 2 return values COALESCE(Col1,Col2,col3, 0) Returns first of attributes that is not null.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top