![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
16/11/2010, 13:06
|
| | Fecha de Ingreso: noviembre-2010
Mensajes: 7
Antigüedad: 14 años, 2 meses Puntos: 0 | |
Respuesta: duda con sum() ya lo solucione le agregue esto (select * from abonos where status='A') en lugar de poner Abonos gracias me fueron de mucha ayuda :)
SELECT
folio,
cliente,
ventas.total,
sum(abs.total)
FROM
ventas LEFT JOIN (select * from abonos where status='A') abs ON abs.referencia=ventas.folio
WHERE
pagado='N' AND
ventas.status='A'
GROUP BY folio |