Re: [SQL] max (timestamp,timestamp)

2006-11-14 Thread T E Schmitz
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

Re: [SQL] max (timestamp,timestamp)

2006-11-13 Thread Michael Fuhr
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

Re: [SQL] max (timestamp,timestamp)

2006-11-13 Thread imad
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

Re: [SQL] max (timestamp,timestamp)

2006-11-13 Thread A. Kretschmer
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

[SQL] max (timestamp,timestamp)

2006-11-13 Thread T E Schmitz
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

Re: [SQL] max timestamp

2004-05-29 Thread boyd (remove_) [EMAIL PROTECTED]
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

Re: [SQL] max timestamp

2004-02-16 Thread Denis
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

Re: [SQL] max timestamp

2004-02-15 Thread Bruno Wolff III
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

Re: [SQL] max timestamp

2004-02-15 Thread Tomasz Myrta
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

Re: [SQL] max timestamp

2004-02-15 Thread Robert Creager
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

Re: [SQL] max timestamp

2004-02-15 Thread Stephan Szabo
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

[SQL] max timestamp

2004-02-15 Thread Michael Sterling
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