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 greates
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);
gr
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;
Even an sql function will do the job here using case statement.
--Imad
www.EntepriseDB.com
On 11/13/06, A. Kretschmer <[EMAIL PROTECTED]> wr
am Mon, dem 13.11.2006, um 13:46:00 + mailte T E Schmitz folgendes:
> I tried the following query but the query fails as
> "function max (timestamp w. timezone,timestamp w. timezone) does not exist"
>
> SELECT id,
>
> MAX(last_updated,
> (SELECT MAX (last_updated) FROM product_category_memb
Michael Sterling wrote:
i'm trying to get the max time stamp, from each day, of a range of
dates, not just the max time stamp for the complete range dates but
for each day.
I don't trust the news client I was using. So will answer again from
the Netscape version; This worked for me:
I have a ta
Hi Michael,
Try this..
ace=> create table test( mytime timestamp );
CREATE
ace=> insert into test values (now() );
INSERT 1823542 1
ace=> insert into test values (now() );
INSERT 1823543 1
ace=> insert into test values (now()-1);
INSERT 1823544 1
ace=> insert into test values (now()-1);
INSERT 18
On Tue, Feb 10, 2004 at 10:14:04 -0800,
Michael Sterling <[EMAIL PROTECTED]> wrote:
> i'm trying to get the max time stamp, from each day, of a range of
> dates, not just the max time stamp for the complete range dates but
> for each day.
SELECT DISTINCT ON can probably do what you want. Somethi
Dnia 2004-02-10 19:14, Użytkownik Michael Sterling napisał:
i'm trying to get the max time stamp, from each day, of a range of
dates, not just the max time stamp for the complete range dates but
for each day.
select max(some_time)
group by some_time::date
or
select max(some_time)
group by date_tr
When grilled further on (10 Feb 2004 10:14:04 -0800),
[EMAIL PROTECTED] (Michael Sterling) confessed:
> i'm trying to get the max time stamp, from each day, of a range of
> dates, not just the max time stamp for the complete range dates but
> for each day.
>
Well, one gross and ugly way is:
SE
On Tue, 10 Feb 2004, Michael Sterling wrote:
> i'm trying to get the max time stamp, from each day, of a range of
> dates, not just the max time stamp for the complete range dates but
> for each day.
Maybe something like?
SELECT CAST(timestampcol AS DATE), max(timestampcol)
FROM thetable
GROUP
10 matches
Mail list logo