sql - Retrieving Online Users By Login and Logout Records -


  • enter image description here

consider userlog table above. save login or logout operation of users table. how can retrieve online users , login time?

something this:

select * userlog l1 operation = 'enter' ,        not exists(select * userlog l2                   l1.user = l2.user ,                         l2.operation = 'exit' ,                         l2.time > l1.time) 

Comments

Popular posts from this blog

timeout - Handshake_timeout on RabbitMQ using python and pika from remote vm -

gcc - MinGW's ld cannot perform PE operations on non PE output file -

c# - Search and Add Comment with OpenXML for Word -