Hello,
I am new to Vertica DB (and the forum), and I am stuck at resolving a query issue. I am using NOT IN clause in my query; however, the results still have the records which should have been excluded because of the NOT IN clause.
For e.g.:
select * from employee where employee_id NOT IN (105,107) ==> This query works fine
select employee_name, employee_id, employee_location, employee_manager, count(*) "leaves" from employee where employee_id NOT IN (105,107) GROUP BY employee_name, employee_id, employee_location, employee_manager
==> This query returns results which has employee_id = 105 and 107
I am not sure why the NOT IN clause is only working when I'm not using it in a GROUP BY clause.
Any pointers would be really helpful. Thank you.