You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND a.dep_codigo = b.dep_codigo ORDER BY a.lab_nome ASC' at line 1