Login
Products
Sales
Support
Downloads
About
Home
»
Technical Support
»
ElevateDB Technical Support
»
Support Forums
»
ElevateDB SQL
»
View Thread
View Thread
The following is the text of the current message along with any replies.
Messages 1 to 2 of 2 total
Calculate with Null
Sun, Jan 17 2010 1:09 PM
Permanent Link
"Sorin H"
Hello
I want to run this sql when all the fields are integers.
"select col1, col2, (col1+col1)"
and when col1 or col2 are Null the calculated field will refer to the Null
fiedls as zero.
I try Coalesce and Cast but the calculation remain the same.
Any suggestions?
Thanks Sorin
Sun, Jan 17 2010 1:51 PM
Permanent Link
Uli Becker
Sorin,
> and when col1 or col2 are Null the calculated field will refer to the Null
> fiedls as zero.
>
> I try Coalesce and Cast but the calculation remain the same.
This works:
select col1, col2, coalesce(col1,0) + coalesce(col2,0) as sum from MyTable;
Regards Uli