Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
charul
Starting Member
18 Posts |
Posted - 2008-07-17 : 00:57:24
|
| I am unable to understand the function of Coalesce. I have seen it being used in a lot of places. Can anybody explain to me. |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-07-17 : 01:27:32
|
| What's is that you dont understand from books online description? |
 |
|
|
charul
Starting Member
18 Posts |
Posted - 2008-07-17 : 03:35:31
|
quote: Originally posted by visakh16 What's is that you dont understand from books online description?
does it check for the first non null apperance? |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2008-07-17 : 03:38:51
|
yes. It return the first NON NULL value KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-07-17 : 03:51:31
|
| its an equivalent of CASE WHEN. it can be thought of asCOALESCE(col1,col2,col3,...) equivalent toCASE WHEN col1 IS NOT NULL THEN col1 WHEN col2 IS NOT NULL THEN col2 WHEN col3 IS NOT NULL THEN col3...END |
 |
|
|
|
|
|