sql - Select a nullable bit with a default value -
I need to select a null qualified bit column in one view, but whenever the value is null, FALSE Use the default value. (For other reasons, I can not even add a default value to the source table.) This is what I am doing.
CAST (case when bit_column IS is in the form of 0 bit bitmile and bit) bit_column, ...
But I am thinking that there is a better / more efficient way to do this.
Isnull function.
isnull (bit_column, 0)
Comments
Post a Comment