select count(*) as zs, 'fwqzl' as name from ywmachineinfo
union all
select count(*) as zs, 'jkzxs' as name from ywvideocurrentstate where (isolation is not null and isonline!=0)
select count(*) as zs, 'jkzxs' as name from ywvideocurrentstate a left join sbtdspsr b on a.videonum=b.sbbh and a.channelnum=b.tdbh where (a.isonline is not null and a.isonline!=0) and b.kz3 is not null and b.kz3 != '1'
union all
select count(*) as zs, 'jkzl' as name from sbtdspsr
select count(*) as zs, 'jkzl' as name from sbtdspsr where kz3 is not null and kz3 != '1'
union all
select count(*) as zs, 'fwqzxs' as name from ywmachinecurrentstate where machinestate=1
from ywvideocurrentstate a right join sbtdspsr d on (d.sbbh=a.videonum and d.tdbh=a.channelnum ) where isonline=0 or isonline is null
from ywvideocurrentstate a right join sbtdspsr d on (d.sbbh=a.videonum and d.tdbh=a.channelnum ) where isonline=0 or isonline is null and d.kz3 is not null and d.kz3 != '1'
union
select 'normal' csdm ,'normal'csmc , count(*) cnt
from ywvideocurrentstate a right join sbtdspsr d on (d.sbbh=a.videonum and d.tdbh=a.channelnum ) where a.isonline is not null and isonline!=0