0
我试图获得传递和失败设备的计数我拥有所有我想要的数字,但它们并不完全正确。按条件计算
例如:
select
t3.displayname as [PSI],
case when t0.compliant = 0 then count(displayname) end as [failures],
case when t0.compliant = 1 then count(displayname) end as [success]
from lineitemsmap as t0
inner join art_blob as t1 on t1.art_blob_id = t0.blobid
inner join art_asset as t2 on t2.art_asset_id = t1.art_asset_id
inner join net_ou as t3 on t3.net_ouid = t2.net_ouid
group by t3.displayname, t0.compliant
生成:
------------------------------
| PSI | failures | success |
------------------------------
| 1 | 3 | NULL |
------------------------------
| 2 | 4 | NULL |
------------------------------
| 3 | 5 | NULL |
------------------------------
| 1 | NULL | 6 |
------------------------------
| 2 | NULL | 7 |
------------------------------
| 3 | NULL | 8 |
------------------------------
我试图让所有的结果,在3行返回第6节