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