How to write the command for sql to update records
This article mainly introduces the sql update record command how to write, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let Xiaobian take you to understand.
Usage 1: UPDATE table name SET column name = new value WHERE column name = a value
Revise the age of student Li Si
UPDATE student SET age = 18 WHERE `name` ='Li Si'
View the modified results
Usage 2: update several columns in a row
UPDATE table name SET column 1 name = new value, column 2 name = new value WHERE column name = a value
Modify the name and age of Li Si
UPDATE student SET `name` ='Li Si 2Xi, age = 100WHERE `name` ='Li Si'
The results show that
Li Si's name has been changed to Li Si 2, the age is 100.
Thank you for reading this article carefully. I hope the article "how to write the order to update the record of sql" shared by the editor will be helpful to everyone. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!