Question on OUTER JOINS.

From: Ludwig Lim <lud_nowhere_man(at)yahoo(dot)com>
To: PostgreSQL Mailing List <pgsql-sql(at)postgresql(dot)org>
Subject: Question on OUTER JOINS.
Date: 2003-06-28 05:45:47
Message-ID: 20030628054547.40824.qmail@web80503.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


Hi:

1) Is the ON clause of an OUTER JOIN always
evaluated first before the WHERE clause?

2) Given the ff SQL statement :

SELECT employee_id,
a.status as status
FROM permissions a LEFT JOIN
(select * from employee where employee_id = 3)
as b on (a.status=b.status)
WHERE a.status='test';

Is there a way to rewrite the query as a view such
that one can do:

select *
from test_view
where employee_id=3 and status='test';

Thank you very much,

ludwig lim

__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2003-06-28 06:03:03 Re: Question on OUTER JOINS.
Previous Message Bruno Wolff III 2003-06-28 00:03:28 Re: need some help with a delete statement