No se si necesites algo así:
Código sql:
Ver originalSELECT cc.nombre,cc.domicilio,cc.telefono,cc.ciudad,t1.totalnc,t2.totalnca,t3.totalpag FROM catclientes cc
FULL OUTER JOIN (SELECT id_cliente, SUM(importe_abono) AS totalnc FROM tblabonos WHERE SUBSTRING(folio_recibo,1,3)='NC-' GROUP BY id_cliente) AS t1
ON cc.id_cliente=t1.id_cliente
FULL OUTER JOIN (SELECT id_cliente, SUM(importe_abono) AS totalnca FROM tblabonos WHERE SUBSTRING(folio_recibo,1,3)='NCA' GROUP BY id_cliente) AS t2
ON cc.id_cliente=t2.id_cliente
FULL OUTER JOIN (SELECT id_cliente, SUM(importe_abono) AS totalpag FROM tblabonos WHERE SUBSTRING(folio_recibo,1,3)='PAG' GROUP BY id_cliente) AS t3
ON cc.id_cliente=t3.id_cliente
o algo así:
Código sql:
Ver originalSELECT cc.nombre,cc.domicilio,cc.telefono,cc.ciudad,
(SELECT SUM(importe_abono) AS totalnc FROM tblabonos WHERE SUBSTRING(folio_recibo,1,3)='NC-') AS sumaNC,
(SELECT SUM(importe_abono) AS totalnca FROM tblabonos WHERE SUBSTRING(folio_recibo,1,3)='NCA') AS sumaNCA,
(SELECT SUM(importe_abono) AS totalpag FROM tblabonos WHERE SUBSTRING(folio_recibo,1,3)='PAG') AS sumaPAG
FROM catclientes cc;
Cuentanos como te va.