pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: boyd (remove_) tb_moore_@bealenet_.com <HeWillRejoice@yahoo.com>
To: pgsql-sql@postgresql.org
Subject: Re: max timestamp
Date: Tue, 10 Feb 2004 14:50:45 -0500
Message-ID: <qCaWb.19169$Gx1.13160@fe01.usenetserver.com> (raw)
In-Reply-To: <f7359f44.0402101014.77198f7b@posting.google.com>
References: <f7359f44.0402101014.77198f7b@posting.google.com>

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





view thread (7+ messages)  latest in thread

Message-ID: <qCaWb.19169$Gx1.13160@fe01.usenetserver.com>
Permalink:  ../qCaWb.19169$Gx1.13160@fe01.usenetserver.com/
Also on:    postgresql.org/message-id/qCaWb.19169$Gx1.13160@fe01.usenetserver.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: HeWillRejoice@yahoo.com
  Subject: Re: max timestamp
  In-Reply-To: <qCaWb.19169$Gx1.13160@fe01.usenetserver.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox