i have to lower the price with 2% for each item where the capacity is more than 200 pcs using two tables where the id's have to be the same and i can not pass this error: ORA-00933: SQL command not properly ended
'Catalog' is a table and 'Order' is the second table
update Catalog
set price = (price - price*0.02) from Catalog inner join Order on
(Catalog.idf = Order.idf and Catalog.idp = Order.idp)
where quantity > 200;
what could be the bug here? thanks!
Oracle does not support a
FROMclause in anUPDATE.Hmmm. If I speculate that
quantityis inorder, then you can use:I am a bit cautious about this. This means that there is a 1-1 relationship between
ordersandcatalog. If there can be more than oneorderfor a catalog entry, then you probably need aggregation. However, this is the logic you seem to be trying to implement in the question.