sql 中updtate语法规则,详细点,举个简易的例子.谢谢.

来源:百度知道 编辑:UC知道 时间:2024/07/02 03:51:17
如题.
是update

语法规则:
Update 表名 set 列名称 = 新值 where 列名称 = 某值
如:
update userinfo SET userName = '张三' where userID = '1001'

update 是用于更新表中数据用的

比如你想把学生名张三换成李四

update table(表名) set name = '李四'
where name = '张三'

这样就可以把叫张三名字的都换成李四了。

谢谢!笔误。。。

作用:用于更新表中指定条件的数据
Update 表名 set 表中字段名=新值 where (条件限制,指写更新哪条记录) 限制字段名称=限制值

Update student set name='李鹏' where no='95001'

SQL Server语法:UPDATE { table_name WITH ( < table_hint_limited > [ ...n ] ) | view_name | rowset_function_limited } SET { column_name = { expression | DEFAULT | NULL } | @variable = expression | @variable = column = expression } [ ,...n ] { { [ FROM { < table_source > } [ ,...n ] ] [ WHERE < search_condition > ] } | [ WHERE CURRENT OF { { [ GLOBAL ] cursor_name } | cursor_variable_name } ] } [ OPTION ( < query_hint > [ ,...n ] ) ]

SQL Server示例: update a set a.gqdltks=b.g