T
Tommi Bauer
I am writing a query in ASP.NET C#,
select sum(size) as total_size from my_table where is_valid = 1
However, if there is no data in the database, it returns 1 record with
value null. How come it doesn't return 0 instead? because I am using
"sum", if SQL can't find any record.. isn't it suppose to return 0?
In my table setup, the default value for the "size" field is 0 and doesn't
allow NULL.
Regards,
T.
select sum(size) as total_size from my_table where is_valid = 1
However, if there is no data in the database, it returns 1 record with
value null. How come it doesn't return 0 instead? because I am using
"sum", if SQL can't find any record.. isn't it suppose to return 0?
In my table setup, the default value for the "size" field is 0 and doesn't
allow NULL.
Regards,
T.