need help with some aggregation magic

From: Andreas <maps(dot)on(at)gmx(dot)net>
To: pgsql-sql(at)postgresql(dot)org
Subject: need help with some aggregation magic
Date: 2011-06-09 13:43:24
Message-ID: 4DF0CDFC.4070802@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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 ?

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Oliveiros d'Azevedo Cristina 2011-06-09 14:16:57 Re: need help with some aggregation magic
Previous Message Scott Marlowe 2011-06-06 23:21:02 Re: To find process that lock a table