i have 2 tables: jobs and cods
jobs cods
idx descr cod descr idx
1 teacher codx codingx 1
2 programmer cody codingy 4
3 sailor codz codingz 2
4 medic codw codingw 3
5 student cods codings 1
codw codingw 1
i want the select, return the rows with codx and codw where the idx column is the join
id descr codx desc_codx codw descr_codw
1 teacher codx codingx codw codingw
2 programmer null null null null
3 sailor null null codw codingw
4 medic null null null null
5 student null null null null
Is it possible with only 1 select?
select x.id, x.descr,a.cod as codx a.desc as desc_codx,b.cod as codw, b.desc as desc_codw
from jobs x, cods a, cods b
where x.id= a.id(+)
and x.id = b.id(+)
and a.cod= 'codx'
and b.cod= 'codw'