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 |
|
adlo
Posting Yak Master
108 Posts |
Posted - 2004-09-02 : 12:19:47
|
| I got a NULLIF(SkillCount,0) as SkillCount in my select statement but it still gives me NULL as value.It must display 0 for the Null values caused by the left outer join.I can't understand why is won't work. |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2004-09-02 : 12:21:42
|
| because NULLIF Returns a null value if the two specified expressions are equivalent.i think you needISNULLReplaces NULL with the specified replacement value.Go with the flow & have fun! Else fight the flow :) |
 |
|
|
ditch
Master Smack Fu Yak Hacker
1466 Posts |
Posted - 2004-09-02 : 12:22:12
|
| isnull(skillcount, 0) ......or coalesce(skillcount, 0)should do it.Duane. |
 |
|
|
adlo
Posting Yak Master
108 Posts |
Posted - 2004-09-02 : 12:24:35
|
| Sorry, I mixed them up. |
 |
|
|
ditch
Master Smack Fu Yak Hacker
1466 Posts |
Posted - 2004-09-02 : 12:29:17
|
| BTWI can remember a thread from this site a couple of months ago where my freind Kristen had decided that he was going to enforce coalesce over isnull at his company as coalesce was ansi standard and isnull was not and another good reason was beacuase coalesce can use multiple values as input params - it just returns the first non null value (this can be very handy at times)Duane. |
 |
|
|
|
|
|