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

JOINs in FROM...

From: "ericnielsen(at)pop(dot)ne(dot)mediaone(dot)net" <ericnielsen(at)pop(dot)ne(dot)mediaone(dot)net>
To: "pgsql-novice(at)postgresql(dot)org" <pgsql-novice(at)postgresql(dot)org>
Subject: JOINs in FROM...
Date: 2001-09-17 14:22:54
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
I've been trying to use the JOIN syntax in the FROM clause instead of burying all the joins in the WHERE.  (Does postgres actually support outer joins now? the user manual seems to imply it does, which version do I need as a minimum?)  The resulting query is much simpler than my old UNION SELECT
cascade, but I must have done something wrong because I get a parse error.

Here's the query and the error.(formatted for monotype)
SELECT ldr.peopleid, ldr.firstname, ldr.lastname,, 
       flw.peopleid, flw.firstname, flw.lastname, 
       FROM (people LEFT JOIN organizatios ON organization=orgid) AS ldr,
            (poeple LEFT JOIN organizatios ON organization=orgid) AS flw,
       WHERE ldr.peopleid=leader and flw.peopleid=follower 
       ORDER BY ldr.lastname, ldr.firstname, flw.lastname, flw.firstname;
Warning: PostgreSQL query failed: ERROR: parser: parse error at or near ","

1) What is the problem with my query?
2) Is there any good way to move the last two joins into the FROM?


mail2web - Check your email from the web at .

pgsql-novice by date

Next:From: Tom LaneDate: 2001-09-17 14:45:20
Subject: Re: Out of memory error
Previous:From: Gerard TOURRESDate: 2001-09-17 10:14:54
Subject: Out of memory error

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