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

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -