Fix for unique query

Correct [NOT_IN] replacement to ([NOT_IN])