Skip site navigation (1) Skip section navigation (2)

Re: syntax of joins

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Andreas <maps(dot)on(at)gmx(dot)net>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: syntax of joins
Date: 2012-04-06 19:23:32
Message-ID: CAFj8pRBc2Qa+_Zap_8VqOQzjaYWXtkajjhKePKs9pYGnkcoX+w@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-sql
Hello

2012/4/6 Andreas <maps(dot)on(at)gmx(dot)net>:
> hi,
>
> is there a disadvantage to write a join as
>
> select   *
> from    a, b
> where  a.id = b.a_id;
>

> over
>
> select   *
> from    a join b  on  a.id = b.a_id;
>

yes - newer notation has some advantages

* clean specification join predicate and filter predicate
* simple adaptability to outer join
* increased protection against copy/paste bug that introduce Cartesian product

Regards

Pavel Stehule

> --
> Sent via pgsql-sql mailing list (pgsql-sql(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-sql

In response to

Responses

pgsql-sql by date

Next:From: Rob SargentDate: 2012-04-06 19:28:08
Subject: Re: syntax of joins
Previous:From: AndreasDate: 2012-04-06 18:58:33
Subject: syntax of joins

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group