ERROR: syntax error at or near ")" LINE 9: WHERE P.id IN () ^