NOT IN in postgresql not working [closed]
I am not getting the output as expected, because AND ta.task_status_type_id NOT IN ( 10 ) is not working in below query. SELECT ta.task_id AS id, u.employee_id AS employee_id, ta.task_status_type_id FROM task_assignments AS ta, users AS u WHERE u.id = ta.user_id AND ta.id IN ( SELECT max ( ta.id ) OVER ( partition BY ta.task_id ) AS id FROM task_details AS td, task_assignments AS ta WHERE td.task_id = ta.task_id AND td.developer_employee_id IS NULL AND ta.task_type_id IN(6,7) AND ta.task_status_type_id NOT IN ( 10 ) AND ta.task_status_type_id IN ( 9 ) ); Please help in resolving the error.