Re: Getting all rows even if not a member of any groups

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Együd Csaba <csegyud(at)freemail(dot)hu>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Getting all rows even if not a member of any groups
Date: 2003-06-27 15:10:25
Message-ID: 20030627151025.GE15269@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Fri, Jun 27, 2003 at 16:18:10 +0200,
Együd Csaba <csegyud(at)freemail(dot)hu> wrote:
>
> This is absolutelly what I want, but I can't understand how it is working.
> Where can I find a descriptive (tale-like, for kids ... :) ) documentation
> about using joins?

If you look at the documentation for the select command and page down a
bit there is a description of join syntax. Note that in 7.4 using
the explicit join syntax won't force join order. (This really only
affects cross joins and inner joins; left and right joins normally
can't be reordered.)

You need a left join to pick up products that aren't in any group.
The parenthesis changed the join order so that group names were attached
to group ids before group ids were joined to products. This can have
performance implications. I think that this is probably the faster
way, but the other option would to have been to make the second join
a left join as well.

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Bruno Wolff III 2003-06-27 15:20:31 Re: Change the behaviour of the SERIAL "Type"
Previous Message Rod Taylor 2003-06-27 14:55:19 Re: Change the behaviour of the SERIAL "Type"