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!

Query to find out the time used by an user for an application

Viswanath KantetiNov 25 2010 — edited Nov 26 2010
Hello All,

I want to know the query to find out the whole time used by the user for an application. Please view the below data

Employee:

SNO EMP_ID EMP_NAME EMP_DATE LOGIN_TIME LOGOUT_TIME
1 10 Visu 21-Nov-2010 06:30:00 07:30:00
2 10 Visu 21-Nov-2010 06:40:00 07:20:00
3 10 Visu 21-Nov-2010 06:50:00 07:50:00
4 10 Visu 21-Nov-2010 07:30:00 08:30:00
5 10 Visu 21-Nov-2010 09:30:00 10:30:00

By checking the above data we can say that the total time Visu used the application is
8.30 - 6.30 (From 1,2,3,4 records) = 2hrs
10.30 - 9.30 (Based on 5th rec) = 1hr

So the total time Visu used the application would be 3 hrs = 180 mins.

Could you please help me in getting the result from that data using a query?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 24 2010
Added on Nov 25 2010
10 comments
766 views