0
我有以下查询给我一个给定的base_objectid的行数:的Oracle SQL相关子查询
Select Count(*)
from
(
select di.id, di.archkey, dc.mimetype, dc.film, dc.blip, dc.originalfilename, stp.id as baseID, null as Volume, stp.path as Dateiname_org, stp.basepath as Pfad, stp.filelength as Dateilaenge
, 1 as "Dateinummer", dc.idx
from
doc_instance di
, doc_content dc
, sto_hydstorageplace stp
where
di.baseobjectid = :base_objectid
and stp.archivekey = di.archkey
and di.id = dc.docinstanceid (+)
and stp.imagenr = dc.idx
union
select di.id, di.archkey, dc.mimetype, dc.film, dc.blip, dc.originalfilename, stf.id as baseID, stf.volume as Volume, stf.filename as Dateiname_org, stol.confvalue as Pfad, stf.filesize as Dateilaenge
, stf.fileno as "Dateinummer", dc.idx
from
doc_instance di
, doc_content dc
, sto_storagefileentry stf
, sto_storagelevelconf stc
, sto_storagelevelconfentry stol
where
di.baseobjectid = :base_objectid
and stf.archkey = di.archkey
and stf.storagelevel = stc.storagelevel
and stc.id = stol.storagelevel
and stol.confkey = 'FILEARCHIVE'
and di.id = dc.docinstanceid (+)
and stf.fileno-1 = dc.idx
) temp
order by archkey, idx
现在我想告诉我属于另一个表中的所有base_objectids行数,所以上述查询必须针对base_objectid的每个特定值执行。我假设我必须将上述查询作为子查询,但是我所有的试验都失败了。