I have to report rows in table A which are not available in table B.
ie)I need to display table A.num, table A.name , table A.desc where
select table A.num minus table B. num
Pls note no columns or values from table B are needed.
I’m able to get the right number of records(ie the count) by doing A.num minus table B. num . But how to select the table A.num, table A. name , table A.desc for those selected table A.num rows?
I don’t think you can do it in WebI without anything being done in the universe beforehand.
Another way how to get rows from the table A that have no appropriate records in the table B is to use a subquery of this type:
select A.num, A.name, A.desc
from table A
where not exists (select 1
from table B
where B.num = A.num
)
Test both cases which one is faster in your case. The performance may depend on the number of rows in both tables and some other factors. So test both cases with your real tables A and B.
I am suspecting Marek Chladny query also will take time. Basically exist operator is more fast but i am thinking in diff way like if TableA have 1000 record and TableB have 50 Record then it will go 1000 times in the loop so can u check this below query and let us know which one is very fast.
[color=darkblue]select num, name, desc
from tableA
where not in (select num
from tableB [/color]
)