Looks like you want a GROUP BY
with conditional aggregation:
SELECT item_id,
sum(case when from_where != 'OPENING' AND transaction_type="C" then quantity end) as CREDITBAL,
sum(case when from_where="OPENING" then quantity end) as OPENBAL,
sum(case when transaction_type="D" then quantity end) as DEBITBAL
FROM axi_quantity_registers
group by item_id
solved redundant rows are then in answer