Re: how to do 'deep queries'?

Поиск
Список
Период
Сортировка
От Daryl Richter
Тема Re: how to do 'deep queries'?
Дата
Msg-id 433947F6.7060106@brandywine.com
обсуждение исходный текст
Ответ на Re: how to do 'deep queries'?  ("Anthony Molinaro" <amolinaro@wgen.net>)
Список pgsql-sql
Anthony Molinaro wrote:
> that query is 100% correct.
>  
> it's just an equijoin (a type of inner join) between 3 tables.
>  
> the syntax you show is how queries should be written and is more
> representative of what a joins between relations really are:
> Cartesian products with filters applied
>  
> the ansi syntax, the explicit JOIN ... ON  stuff is (imho) unnecessary,
> useful only for outer joins since all the vendors did it differently.
>

Whether you feel that is unnecessary or not, it *is* the ANSI Standard 
and is thus, by definition, "how queries should be written."

In addition to cleaning up the outer join issue, it was added to make 
the *intention* of the query clearer.

Because others are likely to read your query many more times than you 
write it, clarity of intent *is* important.

> what you have will work for postgreSQL, I used the syntax you show in my
> book
> for every single join recipe except for outjoins.
>  
> are you seeing errors?
>  
> regards,
>   Anthony

[original snipped]

-- 
Daryl

"We want great men who, when fortune frowns, will not be discouraged."    -- Colonel Henry Knox, 1776



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

Предыдущее
От: "Brandon Metcalf"
Дата:
Сообщение: Re: add column if doesn't exist
Следующее
От: Daryl Richter
Дата:
Сообщение: Re: Updating cidr column with network operator