[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgresql-sql
Subject:    Re: [SQL] max (timestamp,timestamp)
From:       T E Schmitz <mailreg () numerixtechnology ! de>
Date:       2006-11-14 15:02:58
Message-ID: 4559DAA2.9090908 () numerixtechnology ! de
[Download RAW message or body]

Michael Fuhr wrote:
> On Mon, Nov 13, 2006 at 07:29:09PM +0500, imad wrote:
> 
>>max (timestamptz, timestamptz) does not exist already. You need to
>>create a simple function in PLpgSQL something like
>>
>>if a > b
>>return a;
>>else
>>return b;
> 
> 
> Since PostgreSQL 8.1 you can use GREATEST:
> 
> test=> SELECT greatest(1, 2);

That'll be a handy feature! Unfortunately, my server is still on 7.4.


Thanks to everyone for the quick responses.
-- 


Regards,

Tarlika

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic