oracle - Dynamic query to dynamic data -
i new oracle database, trying execute following query
select o.id ovaid , (case when(select count(m.cid) ovamapper m m.id = o.id , m.solutionid = 1)>0 1 else 0 end) sol1, (case when(select count(m.cid) ovamapper m m.id = o.id , m.solutionid = 2)>0 1 else 0 end) sol1, (case when(select count(m.cid) ovamapper m m.id = o.id , m.solutionid = 3)>0 1 else 0 end) sol1 ovatemplate o order o.id
instead of static values solutionid , select other table.
any on appreciated
you use
join
to table contain solutionid. ex
select * ovatemplate join solutiontable on (solutiontable.ovaid=ovatempate.ovaid)
after that, change static values solutionid
Comments
Post a Comment