Re: [SQL] Find periods for a given... action set?

2009-06-22 Thread James Kitambara
actions a3 where a3.user_id=a.user_id and a3.action_mark='BEGIN' and     a3.action_time wrote: From: Mario Splivalo Subject: [SQL] Find periods for a given... action set? To: pgsql-sql@postgresql.org Date: Friday, 12 June, 2009, 1:54 PM I have a table where there are actino

Re: [SQL] Find periods for a given... action set?

2009-06-12 Thread Achilleas Mantzios
Dobro Vece, smth like: SELECT a.user_id,a.action_mark,a.action_time,a.action_time- (select a2.action_time from actions a2 where a2.oid= (select a3.oid from actions a3 where a3.user_id=a.user_id and a3.action_mark='BEGIN' and a3.action_time I have a table where there are

[SQL] Find periods for a given... action set?

2009-06-12 Thread Mario Splivalo
I have a table where there are actinos for some user logged. It's part of the MPI system of some sort. For every user, action type and time of the action is logged. There are many action types but the ones which are of interest to me are BEGIN and END. I need to find the durations for all the p