Re: Reuse of Subselects

From: "P(dot)J(dot) \"Josh\" Rovero" <rovero(at)sonalysts(dot)com>
To: Holger Marzen <holger(at)marzen(dot)de>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Reuse of Subselects
Date: 2004-02-17 12:42:38
Message-ID: 40320C3E.60106@sonalysts.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)sonalysts(dot)com www.sonalysts.com 215 Parkway North
Work: (860)326-3671 or 442-4355 Waterford CT 06385
***********************************************************************

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Joe Lester 2004-02-17 13:17:15 Re: Using NOTIFY... Slow Client Querys
Previous Message Wei Wang 2004-02-17 12:37:45 Re: to_char problem