我是新來的oracle數據庫動態查詢,我想動態數據
select o.id as ovaid ,
(case when(select count(m.cid) from ovamapper m where m.id = o.id and m.solutionid = 1)>0 then 1 else 0 end) as sol1,
(case when(select count(m.cid) from ovamapper m where m.id = o.id and m.solutionid = 2)>0 then 1 else 0 end) as sol1,
(case when(select count(m.cid) from ovamapper m where m.id = o.id and m.solutionid = 3)>0 then 1 else 0 end) as sol1 from ovatemplate o order by o.id
而是執行了solutionid靜態值的下面的查詢,我想從其他表中選擇它。
任何幫助是非常感謝
請提供更清晰的表格架構 –