sql set from where的用法

sql set from where的用法

首页维修大全综合更新时间:2025-07-02 15:21:18

sql set from where的用法

在数据库语言里,set用于更新字段值,如:

update temp set f1=‘ss',f2=0

表示把表temp的字段f1的值修改为字符‘ss',把字段f2的值修改为整数0。

from是指定查询的表名,如:

select * from temp

表示查询表temp所有行列数据。

where则是对操作的数据表加上筛选条件。如:

update temp set f1=‘ss',f2=0 where f2<0

表示对表temp中,仅f2字段的值小于0的才更新。

又如:

select * from temp where f2<0

表示仅查询表temp中f2字段的值小于0的数据。

大家还看了
也许喜欢
更多栏目

© 2021 3dmxku.com,All Rights Reserved.