I am facing the below error
single rows query return more then 1 rows
sql query--
UPDATE INV.SALE_C A
SET A.AMOUNT = ( SELECT (NVL(B.RATE,0) * NVL(B.qty,0)) - (NVL(B.DISCOUNT,0) * NVL(B.qty,0))
FROM INV.SALE_C B
WHERE b.division_id = a.division_id
AND A.ITEM_CODE = B.ITEM_CODE
AND A.BARCODE = B.BARCODE
AND A.INVOICE_NO = B.INVOICE_NO
AND A.SRNO = B.SRNO ---( i am having error with this column values---duplicate)
)
WHERE A.DIVISION_ID = 1
and A.barcode is not null
AND A.ITEM_CODE IS NOT NULL;
same srno , like this there are so many rows, can i use rownum instead of srno column name
please help how to solve this issue