select b.ivno,b.quantity,a.re from iv a,
(select ivno,quantity = sum(quantity) from iv
group by ivno) b
where a.ivno = b.ivno
(select ivno,quantity = sum(quantity) from iv
group by ivno) b
where a.ivno = b.ivno
from iv t0