if value is an array create a NOT IN query