I am trying to update a column of total quantity in each order using query
update orders
set total_items = (SELECT L_QUANTITY AS "TOTAL"
FROM
(SELECT o_orderkey, SUM(L_Quantity) AS "TOTAL"
FROM LINEITEM L
JOIN ORDERS O ON O.O_ORDERKEY = L.L_orderkey
WHERE L.L_orderkey > 1
GROUP BY o_orderkey));
Oracle shows this error:
SQL Error: ORA-00904: "L_QUANTITY": invalid identifier
00904. 00000 - "%s: invalid identifier"