in reply to Re: How to Iterate to Identify Concurrent Users (SQL)
in thread How to Iterate to Identify Concurrent Users

Thanks tye and fenLisesi. I initially started with a database model but found it to be more cumbersome. After your good advice, I created a view and ran fenLisesi query with some modifications. It did the trick. Its slow though but it gets me what I need. I'll benchmark it with Perl code to see which is more efficient. You monks rock!!!
create view foo as select session_id, start_session, end_session, user +_id from bar;
</code> Then I ran
SELECT DISTINCT foo.user_id AS user, foo.session_id AS session1, bar.session_id AS session2, foo.start_session AS start1, bar_.start_session AS start2, foo.end_session AS end1, bar_.end_session AS end2 FROM foo,bar WHERE foo.user_id != bar_.user_id AND bar_.start_session >= foo.start_session AND bar_.start_session <= foo.end_session AND foo.session_id != bar_.session_id order by start1 ASC;