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 |
masterdineen
Aged Yak Warrior
550 Posts |
Posted - 2013-02-19 : 06:02:30
|
Hello there.i have a left join between two tables.Is there a way.. for all the null values that appear due to no relationship, could that be canged to 0. I am already using a case statement, but still not changing them,RegardsRob |
|
bandi
Master Smack Fu Yak Hacker
2242 Posts |
Posted - 2013-02-19 : 06:07:13
|
COALESCE( t1.ColName, 0) t1 is alias for Left Side Table--Chandu |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-02-19 : 06:17:10
|
quote: Originally posted by masterdineen Hello there.i have a left join between two tables.Is there a way.. for all the null values that appear due to no relationship, could that be canged to 0. I am already using a case statement, but still not changing them,RegardsRob
Can you show your case statement?Though you could use functions like ISNULL,COALESCE etc they all do CASE WHEN kind of check internally so even with CASE..WHEN it should work fineJust being curious on what went wrong in your caseAnyways to avoid it you could use any of above functions------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
masterdineen
Aged Yak Warrior
550 Posts |
Posted - 2013-02-19 : 06:17:59
|
excellent. thank you very much.so simple |
|
|
bandi
Master Smack Fu Yak Hacker
2242 Posts |
Posted - 2013-02-19 : 06:28:55
|
quote: Originally posted by masterdineen excellent. thank you very much.so simple
Welcome... Post your CASE statement also to know where that went wrong..--Chandu |
|
|
|
|
|