可以在sql外面包一层即可 select count(*) from ( select count(* ) as cnt from A where A.type not in(select type from B) group by A.type )T;
[quote=引用 5 楼 rucypli 的回复:] 可以在sql外面包一层即可 select count(*) from ( select count(* ) as cnt from A where A.type not in(select type from B) group by A.type )T;
如果你不需要null 那你有两种办法 1、设置数据库默认缺省值null 为0 2、将null转换为0
什么个情况,没有值,应该就是返回0的啊 帖出你的表和测试数据及SQL看看
56,679
社区成员
56,709
社区内容
加载中
试试用AI创作助手写篇文章吧