Re: correlated query as a column and where clause

From: salah jubeh <s_jubeh(at)yahoo(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql <pgsql-general(at)postgresql(dot)org>
Subject: Re: correlated query as a column and where clause
Date: 2011-04-15 16:28:10
Message-ID: 734987.14706.qm@web161516.mail.bf1.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello Tom


Sorry, but I did not get you. I know that the filtering in the where clause and
can be pushed up or down in the parsing tree depending on the optimizer. So in
this certain case, the result could be computed first and filtered by the where
clause later.

Regards

________________________________
From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: salah jubeh <s_jubeh(at)yahoo(dot)com>
Cc: chris(at)chriscurvey(dot)com; pgsql <pgsql-general(at)postgresql(dot)org>
Sent: Fri, April 15, 2011 5:49:35 PM
Subject: Re: [GENERAL] correlated query as a column and where clause

salah jubeh <s_jubeh(at)yahoo(dot)com> writes:
> But, why I can not use the alias of the select statement ( as in the original

> post) in the where clause.

The select list can only be computed after the where clause has filtered
the rows, so such a thing would be circular.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Andrew Sullivan 2011-04-15 16:30:38 Re: How to silence constraint violation logging for an INSERT
Previous Message Paul Millar 2011-04-15 15:55:07 How to silence constraint violation logging for an INSERT