select sum(数) as cjc19281制单,
sum(case when 审核=1 then 数 else 0 end) as cjc19281制单已审核
from tablename
where 制单人='cjc19281'
sum(case when 审核=1 then 数 else 0 end) as cjc19281制单已审核
from tablename
where 制单人='cjc19281'
case when 审核=1 then 数 else 0 end 没看懂"数" 是什么意思??我得情况是“审核人”is null 时表示未审核
“审核人”is not null 时表示审核了
sum(case when 审核 is null then 1 else 0 end) as cjc19281制单已审核
from tablename
where 制单人='cjc19281'
count(审核人) as AllCheckedOrder
from 请购单 inner join 职员表 on 请购单.制单人=职员表.姓名
where 职员ID=@ZhiyuanID两位大哥给了我思路,谢谢。这就给分。