Re: max timestamp

From: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
To: Michael Sterling <stermic(at)gw(dot)co(dot)jackson(dot)mo(dot)us>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: max timestamp
Date: 2004-02-15 20:03:47
Message-ID: 20040215120253.S88869@megazone.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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);

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Tomasz Myrta 2004-02-15 20:11:21 Re: ORDER BY TIMESTAMP_column ASC, NULL first
Previous Message Stephan Szabo 2004-02-15 20:01:38 Re: ORDER BY TIMESTAMP_column ASC, NULL first