Re: [GENERAL] partial time stamp query

2013-02-05 Thread Misa Simic
Kirk Wythers; pgsql-general@postgresql.org Subject: Re: [GENERAL] partial time stamp query On Feb 4, 2013, at 7:03 PM, Misa Simic wrote: Select time2::date, extract('hour' from time2), AVG(avg) from tablename group by time2::date, extract('hour' from time2) Thanks Misa,

Re: [GENERAL] partial time stamp query

2013-02-04 Thread Kirk Wythers
he track > > for any selected set of dates can easily be displayed on a map (the > > platforms are mobile vessels - not fixed sites) > > > > You might adapt some of these ideas for your use case? > > > > Cheers > > > > Brent Wood > > >

Re: [GENERAL] partial time stamp query

2013-02-04 Thread Moshe Jacobson
On Mon, Feb 4, 2013 at 9:45 AM, Kirk Wythers wrote: > I am trying to write a query that grabs one particular day from a > timestamp column. The data are ordered in 15 minute chunks like this: > > 2010-07-07 12:45:00 > 2010-07-07 13:00:00 > 2010-07-07 13:15:00 > 2010-07-07 13:30:00 > etc… > > WHER

Re: [GENERAL] partial time stamp query

2013-02-04 Thread Misa Simic
n a map (the > platforms are mobile vessels - not fixed sites) > > > > You might adapt some of these ideas for your use case? > > > > Cheers > > > > Brent Wood > > > > Programme leader: Environmental Information Delivery > > NIWA >

Re: [GENERAL] partial time stamp query

2013-02-04 Thread Brent Wood
Sent: Tuesday, February 05, 2013 5:58 AM To: pgsql-general@postgresql.org Subject: Fwd: [GENERAL] partial time stamp query Thanks. That worked great! Now I am trying to aggregate these same fifteen minute to hourly. I have tried using date_trunk: date_trunc('hour', derived_tsoil_fifteen_mi

Re: [GENERAL] partial time stamp query

2013-02-04 Thread Kirk Wythers
; > Cheers > > Brent Wood > > Programme leader: Environmental Information Delivery > NIWA > DDI: +64 (4) 3860529 > ____________ > From: pgsql-general-ow...@postgresql.org [pgsql-general-ow...@postgresql.org] > on behalf of Kirk Wythers [wythe...@u

Fwd: [GENERAL] partial time stamp query

2013-02-04 Thread Kirk Wythers
Thanks. That worked great! Now I am trying to aggregate these same fifteen minute to hourly. I have tried using date_trunk: date_trunc('hour', derived_tsoil_fifteen_min_stacked.time2), but date_truck only seems to aggriage the timestamp. I thought I could use AVG(derived_tsoil_fifteen_min_stac

Re: [GENERAL] partial time stamp query

2013-02-04 Thread Kirk Wythers
Thanks. That worked great! Now I am trying to aggregate these same fifteen minute to hourly. I have tried using date_trunk: date_trunc('hour', derived_tsoil_fifteen_min_stacked.time2), but date_truck only seems to aggriage the timestamp. I thought I could use AVG(derived_tsoil_fifteen_min_stac

Re: [GENERAL] partial time stamp query

2013-02-04 Thread Misa Simic
WHERE derived_tsoil_fifteen_min_stacked.time2::date = '2010-07-07'::date On Monday, February 4, 2013, Kirk Wythers wrote: > I am trying to write a query that grabs one particular day from a > timestamp column. The data are ordered in 15 minute chunks like this: > > 2010-07-07 12:45:00 > 2010-07-0

[GENERAL] partial time stamp query

2013-02-04 Thread Kirk Wythers
I am trying to write a query that grabs one particular day from a timestamp column. The data are ordered in 15 minute chunks like this: 2010-07-07 12:45:00 2010-07-07 13:00:00 2010-07-07 13:15:00 2010-07-07 13:30:00 etc… If I wanted all records from july 7th 2010, I would expect 4 x 24 = 96 reco

[GENERAL] partial time stamp query

2013-02-04 Thread Kirk Wythers
I am trying to write a query that grabs one particular day from a timestamp column. The data are ordered in 15 minute chunks like this: 2010-07-07 12:45:00 2010-07-07 13:00:00 2010-07-07 13:15:00 2010-07-07 13:30:00 etc… If I wanted all records from july 7th 2010, I would expect 4 x 24 = 96 reco