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
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_member WHERE
product_category_member.id = product_category.id))
FROM product_category
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
2-16 14:27:20.888205+05:30
(3 rows)
HTH
Thanx
Denis
- Original Message -
From: "Michael Sterling" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, February 10, 2004 11:44 PM
Subject: [SQL] max timestamp
> i'm trying to get the max time st
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
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.
---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?
http://www.postgr
12 matches
Mail list logo