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 7CB8BD1DD17 for ; Sun, 15 Feb 2004 20:03:49 +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 68274-08 for ; Sun, 15 Feb 2004 16:03:47 -0400 (AST) Received: from megazone.bigpanda.com (megazone.bigpanda.com [64.147.171.210]) by svr1.postgresql.org (Postfix) with ESMTP id 20ABED1DCF1 for ; Sun, 15 Feb 2004 16:03:46 -0400 (AST) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 8005A35546; Sun, 15 Feb 2004 12:03:47 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id 7EF6035434; Sun, 15 Feb 2004 12:03:47 -0800 (PST) Date: Sun, 15 Feb 2004 12:03:47 -0800 (PST) From: Stephan Szabo To: Michael Sterling Cc: pgsql-sql@postgresql.org Subject: Re: max timestamp In-Reply-To: Message-ID: <20040215120253.S88869@megazone.bigpanda.com> References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200402/179 X-Sequence-Number: 16869 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 BY CAST(timestampcol AS DATE);