I have a server with PostgreSQL 8.4 which is being rebooted every night at 01:00 (don\'t ask) and need to get a list of connected users (i.e. their timestamps are u.lo
An easy way of getting only time stamps for the current day since 01:00 is to filter with
CURRENT_DATE + interval '1 hour'
So your query should look like this:
SELECT u.login, u.id, u.first_name
FROM pref_users u
WHERE u.login > u.logout AND
u.login > CURRENT_DATE + interval '1 hour'
ORDER BY u.login;
Hope that helps.