本帖最后由 VVANVI 于 2024-10-17 13:15 编辑
- with zs AS --总记录数
- (
- select [图纸号],count([图纸号]) as 记录数 from [子表]
- group by [图纸号]
- ),hg AS -- 完成记录数
- (
- select [图纸号],count([图纸号]) as 记录数
-
- from [子表]
- where [任务状态] = '完成'
- group by [图纸号]
- )
- select
- zs.图纸号,
- zs.记录数,
- hg.记录数 as 完成数,
- case when zs.记录数 = hg.记录数 then '完成' else '不合格' end as 状态
- from zs
- inner JOIN hg on zs.图纸号 = hg.图纸号
复制代码
没有你那个版本 设计器 10.0.5
|