pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: novice <user.postgresql@gmail.com>
To: Filip RembiaƂkowski <plk.zuber@gmail.com>
Cc: pgsql-general@postgresql.org
Cc: pgsql-sql@postgresql.org
Subject: Re: work hour calculations
Date: Sun, 9 Sep 2007 11:06:49 +1000
Message-ID: <ddcb1c340709081806r6cbc6b75vf71e6cfe2f454129@mail.gmail.com> (raw)
In-Reply-To: <92869e660709070513t7d19e836sb6a4543e6beb3b0b@mail.gmail.com>
References: <ddcb1c340709042045lbe5d58fode7497c8eb060c97@mail.gmail.com>
	<ddcb1c340709042054w2dae6fe9v3abe53ecb4a2a0ce@mail.gmail.com>
	<92869e660709070513t7d19e836sb6a4543e6beb3b0b@mail.gmail.com>

On 07/09/2007, Filip RembiaƂkowski <plk.zuber@gmail.com> wrote:
> 2007/9/5, Raj A <raj.ayappan@gmail.com>:
> > correction:
> >
> > > The result I'm expecting for the above to be
> > >
> > >    notification_time    |     finished_time      |     actual
> > > ------------------------+------------------------+-----------------
> > >  2007-07-06 15:50:00+10 | 2007-07-09 07:10:00+10 | 01:20:00
> > >  2007-07-07 12:30:00+10 | 2007-07-09 07:20:00+10 | 00:20:00
>
> Could you please show the data structures ( create table commmands +
> ane constraints you have )?
>
> If you do this, you have much bigger chance of getting an answer :)

sure

create table log
(
id integer PRIMARY KEY,
notification_time timestamp with time zone,
finished_time timestamp with time zone
);

INSERT INTO log values (1, '2007-07-06 15:50', '2007-07-09 07:10');
INSERT INTO log values (2, '2007-07-07 12:30', '2007-07-09 07:20');

SELECT notification_time, finished_time, sum(finished_time -
notification_time) as actual
FROM log
GROUP BY notification_time, finished_time;


view thread (7+ messages)  latest in thread

Message-ID: <ddcb1c340709081806r6cbc6b75vf71e6cfe2f454129@mail.gmail.com>
Permalink:  ../ddcb1c340709081806r6cbc6b75vf71e6cfe2f454129@mail.gmail.com/
Also on:    postgresql.org/message-id/ddcb1c340709081806r6cbc6b75vf71e6cfe2f454129@mail.gmail.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: user.postgresql@gmail.com, plk.zuber@gmail.com, pgsql-general@postgresql.org
  Subject: Re: work hour calculations
  In-Reply-To: <ddcb1c340709081806r6cbc6b75vf71e6cfe2f454129@mail.gmail.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