Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> 3 Table Outer Join
I'm trying to perform an outer join using 3 tables. The tables track books on tape & are as follows:
BOOKS- has book id & book info
TAPES- has tape id, bookid table & other info
RENTALS- rental id, tape id & rental info
(note: if 1 tape has been rented, the book is considered rented)
Here is the query I've been working with. The results give me all tapeid's & book titles that have not been rented...when I only want the book title(s) with absolutely no tape rentals. Thanks in advance for your help. lh
select t.tape, b.book, b.title, r.rentid
from tapes t, books b, rentals r
where b.bookid=t.bookid and t.tapeid not in(select tapeid from rentals) and t.tapeid=r.tapeid(+);
![]() |
![]() |