Re: correlated query as a column and where clause

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>
Subject: Re: correlated query as a column and where clause
Date: 2011-04-15 15:49:35
Message-ID: 24748.1302882575@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Paul Millar 2011-04-15 15:55:07 How to silence constraint violation logging for an INSERT
Previous Message salah jubeh 2011-04-15 15:49:20 Re: correlated query as a column and where clause