SELECT id, name, IF(sessions.status IS NOT NULL, '1','0') FROM users