Single VIEW, Everybody JOIN!

Поиск
Список
Период
Сортировка
От wyatt@draggoo.com
Тема Single VIEW, Everybody JOIN!
Дата
Msg-id 20011107210133.8483.cpmta@c001.snv.cp.net
обсуждение исходный текст
Ответы Re: Single VIEW, Everybody JOIN!  (Masaru Sugawara <rk73@echna.ne.jp>)
Список pgsql-sql
After looking at some other scary nested LEFT JOINs from the list (thanks Josh), I have determined that I still don't
knowthe difference between a normal JOIN, a LEFT JOIN and a RIGHT JOIN, but I think I got the whole library thing to
work.

Now, can someone tell me if this is the way it is supposed to look, of if it's just nuts?

And finally, what should I do about series with different authors for each book --- how do I get them together in the
ORDERBY without taking the rest of the series away from the rest of the books by their authors?
 

DROP VIEW booklist;
CREATE VIEW booklist AS(SELECT    book.title AS title,    author.last AS last,    author.first AS first,
author.middleAS middle,    series.name AS series,    bookseries.place AS place,    set.name AS setFROM    (        (
       book LEFT JOIN            (                bookauthor LEFT JOIN author                ON bookauthor.ian =
author.ian           )            ON book.ibn = bookauthor.ibn        ) LEFT JOIN (            (
bookseriesLEFT JOIN series                ON bookseries.isn = series.isn            )        )        ON book.ibn =
bookseries.ibn   ) LEFT JOIN (        bookset LEFT JOIN set        ON bookset.ign = set.ign    )    ON book.ibn =
bookset.ibnORDERBY    set, last, first, middle, series, place, title
 
);

Thanks,
Wyatt




В списке pgsql-sql по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: RIGHT JOIN is only supported with mergejoinable join conditions
Следующее
От: "Nick Fankhauser"
Дата:
Сообщение: Re: RIGHT JOIN is only supported with mergejoinable join conditions