Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> 3 Table Outer Join

3 Table Outer Join

From: lh1010 <lhendersNOlhSPAM_at_polaris.umuc.edu.invalid>
Date: 2000/04/12
Message-ID: <1ac2abca.431acb4e@usw-ex0105-038.remarq.com>#1/1

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(+);



Received on Wed Apr 12 2000 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US