postgresql7.1 select u.user_id from cc_users u, acs_objects relo where relo.object_id = u.rel_id and age(u.last_visit) > interval '$days days' and age(relo.last_modified) > interval '$days days' and u.member_state = 'approved'