sql - Retrieving Online Users By Login and Logout Records -
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
Post a Comment