带有WHERE子句的UPDATE查询的基本语法:
UPDATE table_name
SET column1 = value1,column2 = value2...,columN = valueN
WHERE [condition];
====Demo====
image.png
(1)更新ID为6的客户的地址:
sqlite>UPDATE COMPANY SET ADDRESS = 'Texas' WHERE ID = 6;
结果如下:
image.png
(2)修改COMPANY表中ADDRESS 和SALARY列的所有值,不需使用WHERE子句
sqlite > UPDATE COMPANY SET ADDRESS = 'Texas',SALARY = 20000.00;
结果如下:
image.png
网友评论