Re: sql help, reusing a column

From: Andy Colson <andy(at)squeakycode(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: sql help, reusing a column
Date: 2010-04-30 01:59:34
Message-ID: 4BDA3986.9030109@squeakycode.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 04/29/2010 05:08 PM, Thomas Kellerer wrote:
> SELECT organization, state, lastdate, age(lastdate)
> FROM (
> SELECT organization,
> state,
> (select max(idate) from times where
> customers.custid=times.custid and taskid = 27) as lastdate
> FROM customers
> ) t
> order by lastdate desc

Ah, yes, that does work, very nice. Thank you.

-Andy

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jaime Rodriguez 2010-04-30 02:07:48 Re: Performance and Clustering
Previous Message DM 2010-04-29 23:57:02 Re: PostgreSQL Performance issue