Personal tools
You are here: Home DB2 How To's How to select null values as 0 values
Navigation
Log in


Forgot your password?
 
Document Actions

How to select null values as 0 values

using coalesce function

 

db2 "insert into nulo2 (select coalesce(num,0),coalesce(name,'0') from table1)"

Where num is an int column and name is a char column.

If any values return null from num or name column, the results will be 0.

Security Awareness
Would you like your company to implement gamification into your security awareness program?





Polls