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

SQL question

From: kevin kempter <kevin(at)kevinkempterllc(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: SQL question
Date: 2008-03-29 04:59:28
Message-ID: 69712BCF-F10A-4874-BD7D-9A40E1474E19@kevinkempterllc.com (view raw or flat)
Thread:
Lists: pgsql-general
Hi List;

I have a table that has 3 date columns :

create table xyz (
xyz_id integer,
date1   timestamp,
date2   timestamp,
date3   timestamp
)


I want to select in a query the xyz_id and the max date column for  
each row
something like :
create table temp2 as select xyz_id (max date?) where ...

Is this - the (max date?) part a case scenario or is there a better,  
more efficient method ?

Thanks in advance


Responses

pgsql-general by date

Next:From: Adam RichDate: 2008-03-29 05:03:33
Subject: Re: SQL question
Previous:From: Sushant SinhaDate: 2008-03-29 04:35:21
Subject: Re: Fragments in tsearch2 headline

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