multiple join between tables and aliases

2004-05-28 Thread Thomas Fischer
Hi, I wonder how I should best create a multiple join between two tables. Consider the following example: There are two tables, AUTHOR and BOOK. Assuming that each book has two authors, the BOOK table has two references on the AUTHOR table by two foreign keys, AUTHOR_ID and SECOND_AUTHOR_ID.

RE: multiple join between tables and aliases

2004-05-28 Thread Thomas Fischer
select from BOOK,AUTHOR,BOOK B where BOOK.AUTHOR_ID=AUTHOR.AUTHOR_ID AND B.SECOND_AUTHOR_ID=AUTHOR.AUTHOR_ID Should the query look like this? SELECT FROM book, author a1, author a2 WHERE book.author_id = a1.id AND book.second_author_id = a2.id Pls correct me if I am wrong.