创建物化视图使用以下查询语句报ORA-22818:不支持下面方式子查询
村野樵夫 2014-07-24 09:00:27 麻烦给改造以下sql使之创建物化视图是正确的:
select
assetip,
mac,
(select count(distinct t.AGENTID)
from TD_agentpatchrel t, td_agent t1
where t.AGENTID = t1.AGENTID
and t1.state = 1
and t.PATCHSTATUS = 0) unPatchedCount,
(select count(t.id) from td_avsoft t,td_agent t1 where t.agentid=t1.agentid and t1.state =1) avsoftCounts,
(select count(assetcode) from ass_asset_baseinfo) deviceCount,
(select count(os) from td_agentinfo where os='2') xp,
(select count(os) from td_agentinfo where os='5') win7,
(select count(os) from td_agentinfo where os in('1','2','3','4','5','6','7')) wins,
(select count(os) from td_agentinfo where os='0') nowins,
(select count(asset_type) from td_agentinfo where asset_type='999999999999999005') desktopCount,
(select count(asset_type) from td_agentinfo where asset_type='999999999999999006') laptopCount,
(select count(asset_type) from td_agentinfo where asset_type='999999999999999002') serverCount
from td_agentinfo