UPDATE是我们常SQL语句之一,update主要用于更改表中的现有数据.
更新一个表:update product set l_parentid ='1'
详细解说: update 表名 set 列名 =参数
更新两个表或多个表: update product set l_parentid = producttype.parentid from product,producttype where product.l_typeid =producttype.id
详细解说: update 表名 set 列名 =参数 from 表名1,表名2 where 指定条件
UPDATE
详细语法
{
table_name WITH ( < table_hint_limited > [ ...n ] )
| view_name
| rowset_function_limited
}
SET
{
column_name = { expression
| DEFAULT | NULL }
| @variable = expression
| @variable = column =