Ver originalSELECT f.*,c.nombre,c.direccion,c.ciudad,c.rfc,c.*,e.estado_nombre, sum(d.importe*d.cantidad) as importe FROM factura f left join clientes c on c.ide=f.cliente INNER JOIN detalle_factura d on f.ide=d.factura left join estados e on e.estado_id=c.estado where f.ide=1