autosprout/sql/quartz.sql
2025-04-12 16:43:21 +08:00

14 lines
466 B
SQL

select bhv.id,count(1) as Bound
from bst_hardware_version bhv
left join bst_device bd
on bhv.id = bd.hardware_version_id
where bd.mch_id is not null
group by bhv.id
select bhv.id,count(1) as unBound
from bst_hardware_version bhv
left join bst_device bd
on bd.hardware_version_id = bhv.id
where bd.mch_id is null
group by bhv.id