-1

Let's say I have a table called 'PRODUCTS' and I need to update this table when a sale is completed. Is there any way to combine all of the updates into one SQL statement?

Currently I have something like:

UPDATE PRODUCT
SET PROD_Q=PROD_Q - 1
WHERE PROD_CODE='A'

UPDATE PRODUCT
SET PROD_Q=PROD_Q - 1
WHERE PROD_CODE='B'

...

Isn't there a more effective method of doing this?

4

2 に答える 2