I came across this code while searching through the "Oracle 10g Complete Reference" by Kevin Loney. It provides a much faster approach to finding out records that belonging to one table and not to an other.
So the query:select TITLEcan be replaced by
from BOOKSHELF
where TITLE not in (Select TITLE from BOOKSHELF_CHECKOUT)
order by TITLE;
select distinct B.TITLE
from BOOKSHELF_CHECKOUT BC right outer join BOOKSHELF B
on BC.TITLE = B.TITLE
where BC.TITLE = NULL
order by TITLE;
0 comments:
Post a Comment