I am looking am using mysql to find a users login/logout details
The database looks like this:
Login TIME,
Logout TIME,
Date, DATE
So, I have a query that searches between two times ranges and a date.
Within this date range there could be multiple login/logout details so how could I grab the first login from the range and the last logout?
As @Joachim and @Douglas have already said you should give more detail when asking a question. Include what you have tried so far and full table structures (output from
SHOW CREATE TABLEis good).Assuming that you have the user_id in this table you can use something like –