you can derive many ways to get the desired output.
Simply
SELECT Billno,Item, SUM(Quantity) FROM Temporderdetails group by Item, Billno
Complex
SELECT DISTINCT Billno,Item,(SELECT SUM(Quantity) FROM Temporderdetails WHERE item=tn.item GROUP BY Item) FROM Temporderdetails tn
recommended, don't go for complex queries.