- What if the row is in TAble A and not in table B? do you still want to display it? This will help you decide whether you want to make an inner join or an outer join.
Assuming this is so, you can get the details using ..
select a.id, a.flag, b.flag from table_a a, table_b b where a.id = b.id(+)
Since you need strings where the flag is not equal.
select a.id, a.flag, b.flag from table_a a, table_b b where a.id = b.id(+) and a.flag <> b.flag
Also check if the flag can be null, in which case you may need to modify the request a bit.
source share