X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 89CECD1CB0F for ; Mon, 16 Feb 2004 09:02:38 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 44990-03 for ; Mon, 16 Feb 2004 05:02:33 -0400 (AST) Received: from cyber12.e-insites.com (ns10.nic-reg-dns.com [66.206.10.2]) by svr1.postgresql.org (Postfix) with ESMTP id 1C751D1C9AB for ; Mon, 16 Feb 2004 05:02:31 -0400 (AST) Received: from server2k ([61.11.69.7]) by cyber12.e-insites.com with MailEnable ESMTP; Mon, 16 Feb 2004 01:06:45 -0800 Received: from 192.168.50.15 by server2k ([192.168.50.102] running VPOP3) with SMTP for ; Mon, 16 Feb 2004 14:39:00 +0530 X-MSReally-From: sqllist@coralindia.com Message-ID: <00b001c3f46a$f9101f80$0f32a8c0@denisnew> From: "Denis" To: References: Subject: Re: max timestamp Date: Mon, 16 Feb 2004 14:27:54 +0530 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Server: VPOP3 V1.5.0 - Registered X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=1.5 tagged_above=0.0 required=5.0 tests=BAYES_00, RCVD_IN_DSBL, RCVD_IN_NJABL, RCVD_IN_NJABL_PROXY, RCVD_IN_OPM, RCVD_IN_OPM_HTTP, RCVD_IN_SORBS, RCVD_IN_SORBS_HTTP, RCVD_IN_SORBS_MISC, RCVD_IN_SORBS_SOCKS X-Spam-Level: * X-Archive-Number: 200402/192 X-Sequence-Number: 16882 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 1823545 1 ace=> insert into test values (now()-2); INSERT 1823546 1 ace=> select * from test; mytime ---------------------------------- 2004-02-16 14:27:15.936368+05:30 2004-02-16 14:27:20.888205+05:30 2004-02-15 00:00:00+05:30 2004-02-15 00:00:00+05:30 2004-02-14 00:00:00+05:30 (5 rows) ace=> select to_char(mytime,'dd-mm-yyyy'),max(mytime) from test group by 1; to_char | max ------------+---------------------------------- 14-02-2004 | 2004-02-14 00:00:00+05:30 15-02-2004 | 2004-02-15 00:00:00+05:30 16-02-2004 | 2004-02-16 14:27:20.888205+05:30 (3 rows) HTH Thanx Denis ----- Original Message ----- From: "Michael Sterling" To: Sent: Tuesday, February 10, 2004 11:44 PM Subject: [SQL] max timestamp > 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.postgresql.org/docs/faqs/FAQ.html