Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Create sql query to calculate login time

3361655Dec 12 2016 — edited Dec 14 2016

Hello collegues,

I need your help.

I'm trying to calculate the time enlapsed between login and logout of each user in specifc function of my application.

I don't have rights on the database to create procedures and triggers...

Can you help me to create a query?

Example:

IDUserFunctionDateTimeTask

1

User1X2016-09-0206:08:00Login
2User2Z2016-09-0206:08:32Login
3User1X2016-09-0206:09:00Logout
4User2Z2016-09-0206:09:32Logout
5User1X2016-09-0206:09:38Login
6User1X2016-09-0206:10:38Logout
7User2A2016-09-0306:10:35Login
8User2A2016-09-0306:11:36Logout

The desired result:

UserFunctionDateTime enlapsed
User1X2016-09-0200:02:00
User2Z2016-09-0200:01:00
User2A2016-09-0300:01:01

Thanks in advance!!

Best Regardss

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 11 2017
Added on Dec 12 2016
13 comments
1,807 views