query to filter user according to scheme for shift assignment