Re: Reuse of Subselects - Mailing list pgsql-general

From P.J. \"Josh\" Rovero
Subject Re: Reuse of Subselects
Date
Msg-id 40320C3E.60106@sonalysts.com
Whole thread Raw
In response to Reuse of Subselects  (Holger Marzen <holger@marzen.de>)
List pgsql-general
temporary tables work.  Save the complicated
subselect in temporary table, following
queries just simple select on temp table.

Holger Marzen wrote:
> Hi all,
>
> if I have something like this:
>
> SELECT column1,
>        (... complicated subselect ...),
>        column1 - (... same subselect as above ...)
> FROM table1;
>
> do I really have to rewrite the subselect a 2nd time if I need that
> result in another column's expression?

--
P. J. "Josh" Rovero                                 Sonalysts, Inc.
Email: rovero@sonalysts.com    www.sonalysts.com    215 Parkway North
Work: (860)326-3671 or 442-4355                     Waterford CT 06385
***********************************************************************

pgsql-general by date:

Previous
From: "Wei Wang"
Date:
Subject: Re: to_char problem
Next
From: Joe Lester
Date:
Subject: Re: Using NOTIFY... Slow Client Querys