
El problema que tengo es con el siguiente query
Código:
El problema es que el query me devuelve datos pero repetidos, creo q me falta una condicion en el query o en el subquery pero noc donde, estaba haciendo pruebas pero me siguen saliendo repetidos SELECT p.id, p.descripcion, SUM( de.cant ) , SUM(dv.cant) FROM producto p, detalleentrega de, detalleventa dv,entrega e,venta v,cliente c where de.idproducto in (select p.id from producto p, detalleentrega de, detalleventa dv where dv.idproducto=p.id and de.idproducto=p.id ) and dv.idproducto in (select p.id from producto p, detalleentrega de, detalleventa dv where dv.idproducto=p.id and de.idproducto=p.id ) and e.id=de.idEntrega and v.id=dv.idventa and c.id=e.idcliente and c.id=v.idcliente and c.id='C-001'

Gracias de antemano
Leo.