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 89125D1CCBE for ; Tue, 10 Feb 2004 20:16:10 +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 67210-10 for ; Tue, 10 Feb 2004 16:16:04 -0400 (AST) Received: from news.hub.org (news.hub.org [200.46.204.72]) by svr1.postgresql.org (Postfix) with ESMTP id 5EADED1B557 for ; Tue, 10 Feb 2004 16:16:03 -0400 (AST) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.12.9/8.12.9) with ESMTP id i1AKG31Y028558 for ; Tue, 10 Feb 2004 20:16:03 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id i1AJokFA023657 for pgsql-sql@postgresql.org; Tue, 10 Feb 2004 19:50:46 GMT From: "boyd (remove_) tb_moore_@bealenet_.com" User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 X-Accept-Language: en-us, en MIME-Version: 1.0 X-Newsgroups: comp.databases.postgresql.sql Subject: Re: max timestamp References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Lines: 24 Message-ID: X-Complaints-To: abuse@usenetserver.com X-Abuse-Info: Please be sure to forward a copy of ALL headers X-Abuse-Info: Otherwise we will be unable to process your complaint properly. Date: Tue, 10 Feb 2004 14:50:45 -0500 To: pgsql-sql@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200402/108 X-Sequence-Number: 16799 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 table, sis, with schema: Table "sis" Column | Type | Modifiers --------+--------------------------+----------- time | timestamp with time zone | stat10 | integer | ipf10 | real | ipf30 | integer | select date_part ( 'doy',time ) as jday, max ( time ) from sis group by jday (doy means day of year, which I called jday) Boyd