M
M
MRcracker2020-11-13 13:42:19
MySQL
MRcracker, 2020-11-13 13:42:19

How to lower the price of a product?

The task is this. You need to select all the data from the cars table that are in the range from 100000 to 200000 and reduce the price for all of them by 3000. Tell me what you need to add to the query?

$UpdateInsert = execQuery('UPDATE cars SET cost = 3000 FROM cars WHERE cost BETWEEN 100000 AND 200000;');

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2020-11-13
@MRcracker

update cars set cars.cost = (cars.cost - 3000) where cars.cost between 100000 and 200000;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question