thinkphp如何查出值是null的布尔类型的值
exp 是用原生表达式查询的意思
$res=Db::table('tbcardlist')->where('qc_hr_wac_hadsend','exp','is null or qc_hr_wac_hadsend=0')->order('ID','asc')->find();
查询值是null的字段的值时,要写 name is null 写 name = null 是查不出正确的数据的
要写 name is null
select top 10 * from tbcardlist where qc_hr_wac_hadsend is null or qc_hr_wac_hadsend=0 order by ID asc
select top 10 * from tbcardlist where qc_hr_wac_hadsend is null order by ID asc
select top 10 * from tbcardlist where qc_hr_wac_hadsend is not null order by ID asc