Skip site navigation (1) Skip section navigation (2)

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: (view raw, whole thread or download thread mbox)
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.


In response to

pgsql-general by date

Next:From: Jaime RodriguezDate: 2010-04-30 02:07:48
Subject: Re: Performance and Clustering
Previous:From: DMDate: 2010-04-29 23:57:02
Subject: Re: PostgreSQL Performance issue

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group