Home > Database > Mysql Tutorial > mysql更改table数据的方法_MySQL

mysql更改table数据的方法_MySQL

WBOY
Release: 2016-06-01 13:12:15
Original
1149 people have browsed it

更改数据表中的某一项数据可以使用update命令,具体使用方法如下:

如下表,表名为aaa:

+----+--------+--------+--------------+
| id | nodeId | type   | domain       |
+----+--------+--------+--------------+
|  1 | vlsr1  | type1    | blue            |
|  2 | vlsr2  | type2    | red              |
+----+--------+--------+--------------+

想要更改blue为yellow,则使用如下语法:

update aaa set domain='yellow' where id='1';

即可完成修改

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