Home > Database > SQL > sql command to update records

sql command to update records

angryTom
Release: 2019-07-22 14:51:45
Original
6604 people have browsed it

sql command to update records

Recommended tutorial: SQL tutorial

Usage one: UPDATE table name SET column name = new value WHERE column name = a certain value

Modify the age of student Li Si

UPDATE student SET age = 18 WHERE `name` = '李思'

sql command to update records

sql command to update records

##View the modified Result

sql command to update records

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 certain value

Modify Li Si's name and age

UPDATE student SET `name` = '李思2', age = 100WHERE `name` = '李思'

sql command to update records

The results show

The name of Li Si was changed to Li Si 2 and the age is 100

sql command to update records##

The above is the detailed content of sql command to update records. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
sql
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template