From: | "Oliveiros d'Azevedo Cristina" <oliveiros(dot)cristina(at)marktest(dot)pt> |
---|---|
To: | "Andreas" <maps(dot)on(at)gmx(dot)net>, <pgsql-sql(at)postgresql(dot)org> |
Subject: | Re: need help with some aggregation magic |
Date: | 2011-06-09 14:16:57 |
Message-ID: | F17937FAF7064F8DB2173ADD36DC2115@marktestcr.marktest.pt |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
The ts means the time the user started on a project ?
Or the time he finished?
Or can mean both? If so, how do you can tell one from the other? Different
event_type s ?
Is it correct to assume from your words that an user cannot be in more than
one project at the time? If so, can't be overlapping, right?
Best,
Oliveiros
----- Original Message -----
From: "Andreas" <maps(dot)on(at)gmx(dot)net>
To: <pgsql-sql(at)postgresql(dot)org>
Sent: Thursday, June 09, 2011 2:43 PM
Subject: [SQL] need help with some aggregation magic
> hi,
> I have a log-table that stores events of users and projects like this
> ( user_id integer, project_id integer, ts timestamp, event_type integer )
>
> I need an aggregated list of worktime per user, per project, per day.
>
> The users can switch projects during the day so I can't work this out with
> min(ts) and max(ts).
>
> Is there a clever way to get this with SQL ?
>
> --
> Sent via pgsql-sql mailing list (pgsql-sql(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-sql
From | Date | Subject | |
---|---|---|---|
Next Message | Andreas | 2011-06-09 16:13:36 | Re: need help with some aggregation magic |
Previous Message | Andreas | 2011-06-09 13:43:24 | need help with some aggregation magic |