Error
Se produjo un error al acceder a la base de datos
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.obsoleto=0 AND a.nombre LIKE '%%' ) nm_sel_esp' at line 1
select count(*) from (SELECT a.idart as idart, a.nombre as nombre, a.onhandquantity as existglobal, x.idalm as idalm, x.cant as existalm, (select COALESCE(sum(p.cant_pdte),0) from cpeddet p left join cped vp on vp.idcped=p.idcped where p.idart=a.idart and vp.statdcto=2) as pdtes FROM almart x LEFT OUTER JOIN art a ON x.idart = a.idart WHERE x.idalm= AND a.obsoleto=0 AND a.nombre LIKE '%%' ) nm_sel_esp