L
L
lexxand2022-01-25 10:26:23
PHP
lexxand, 2022-01-25 10:26:23

How to update multiple values ​​in mysql base rows?

There is a simple table in the database with three columns:
id, name, gorod

How to update the value of gorod, in rows with id from 50 to 100 for example?
The meaning of the task is that certain id ranges must be assigned a certain value gorod, for example - moskow
Can this be done with a regular SQL query?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
X
xIgoRx, 2022-01-25
@lexxand

UPDATE `table_name` SET `gorod`='moskow' WHERE `id`>50 AND `id`<100;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question