在SQL中如何向指定的某一行的某一列插入值

一个表有id,name ,如何向指定的id插入name
insert into table(name) values ('王五') where id='1' 错误,才知道insert不支持where ,请问如何解决??谢谢
其中name可以为空,也就是未插入前name=null

第1个回答  2008-09-23
正确的语句如下:
update table set name='王五' where id='1'

主意例子里面的table、name都是仅仅是例子,实际中不应该使用关键字作为表和列的名字。
第2个回答  推荐于2018-04-20
用update

update table
set name='王五'
where table.id='1'本回答被提问者和网友采纳
第3个回答  2008-09-23
晕`~

update table_name set col_name='王五' where ID=1;
相似回答