var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: using an exists in, inside of a decode
I have two tables tblA and tblB
each has a field named id
all of the id records in tblB are in tblA, but not all of the records in tblA are in tblB.
What I want to do in my query is have a field that returns if the id in tblA is in tblB.
Here is what I have for a query
It doesn't work quite right. Does anyone know how to tweak it to get it to?
decode (tblA.id, tblA.id IN (select id from tblB), 'Exists',
, 'Does not exist'),
Just a shot, but try an outer join like so -
Since you outer join, you grab all ids from A, and any matching from B. If the id from A and B match, obviously it is in both tables. If the id is not in B, matching A.ID to null will return NOT EXISTS.
decode(a.id, b.id, 'EXISTS', 'NOT EXISTS')
where a.id = b.id (+)
Hope this helps!
Oracle OCPI (Certified Practicing Idiot)
Thank you soooooo much
I was trying to maker it hareder than it needed to, and the outer join is all I really need to do. Thanks!