Search Postgresql Archives

Re: sql help, reusing a column

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux