Update SQL to get all users (and filter them) properly