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 obligacion_por_llave.id_obligacion_llave= aporte_llave.id_obligacion_llave a' at line 1