I have table 'products' and I need to update 'price' field by 20% if product 'type' field is "imported".
How do I read and update field at the same time in my UPDATE query?
You can do that using the SQL's Update statement
:
UPDATE products
SET price = price * 1.2
WHERE type = 'Imported'
This will increase the price
of all imported
products
by 20%.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With