SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at or near "group" LINE 1: ...zen where a.status in(0,2,99) and c.id_armazen = group by a... ^