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的每個特定值執行。我假設我必須將上述查詢作爲子查詢,但是我所有的試驗都失敗了。