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

mysql更改table数据的方法_MySQL

WBOY
WBOYOriginal
2016-06-01 13:12:151146browse

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

如下表,表名为aaa:

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

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

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

即可完成修改

Statement:
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