1 person found this helpful
I don't know your tables, but I am having a hard time accepting that your logic is correct.
You join table 'item' back to itself by corr_acc_no. Is this table unique by corr_acc_no? If so, then there seems to be no point to the join.
If it is not unique by corr_acc_no, then you should get a cartesian product.
As mention be mtefft I think your logic is wrong - I think what you want is:
where corr_AcC_no in (select corr_acc_no from bank where local_Acc_no in ('MBL-SEG-NZD'))
Thanks to both of you. @LakmalRajapakse your answer is bang on right. I did the same way after I posted this. I realized there's no point joining item with itself when I can get it done in single query. It's just that I was having hard time with 'Case' in select to get whatever I want,so I tried this logic. But then gave a try to decode, it worked. Thanks anyways.