布尔值在数据库存储中,已经转化为数字1(True)、0(False),所以在查看的过程中需要将布尔值转化为相应的int来替换。

查询为真的
select count() from table where field<>0
查询为假的
select count(
) from table where field=0

用例:
数据库表定义:

数据:

执行sql语句:

select count(*) from labor_shift_split_rule 
where dayFusion<>0

返回结果: