问题:
当int类型的字段没赋默认值为0,当插入数据为空时如何使用查询条件吧为null的数据查出来
错误:
select * from table where a = null ?
正确
select * from table where isNull(a);
把这些值都批量赋0后修改字段的默认值设为0,当下次再查询是判断a = 0即可
update table set a = 0 where isNull(a);
问题:
当int类型的字段没赋默认值为0,当插入数据为空时如何使用查询条件吧为null的数据查出来
错误:
select * from table where a = null ?
正确
select * from table where isNull(a);
把这些值都批量赋0后修改字段的默认值设为0,当下次再查询是判断a = 0即可
update table set a = 0 where isNull(a);