My database holds a 'lastOnline' timestamp variable that get updates when a user logs in. I want to use this to retrive 3 values
[The total amount of users][users online today][users online in the last hour].
I can do each statement seperately
SELECT count(u.id) AS usersTotal FROM user u
SELECT count(u.id) AS usersDay FROM user u
WHERE u.lastOnline >= now() - INTERVAL 1 DAY
SELECT count(u.id) AS usersHour FROM user u
WHERE u.lastOnline >= now() - INTERVAL 1 HOUR
but I am having trouble joining/union the 3 of them into one query
Thank you