Find Online Users
select a.username, li.last_login, li.last_ip from ores.login_info li join ores.accounts a on a.id = li.account_id and a.valid_to = '9999-12-31 23:59:59'::timestamptz where li.online = 1;
select a.username, li.last_login, li.last_ip from ores.login_info li join ores.accounts a on a.id = li.account_id and a.valid_to = '9999-12-31 23:59:59'::timestamptz where li.online = 1;