sql里面要想准确插入数据怎么写?

来源:百度知道 编辑:UC知道 时间:2024/06/12 17:37:25
例如,要在id=6的记录上插入一个name='joey',能用insert实现吗?

用update:
update 表 set name = 'joey' where id = 6

insert 是直接插入,象你所说的那样应该用update,sql语句为:
update [表名] set name='joey' where id=6

你是要插入一个字段还是要把这个数据方到这个表本来就有的字段上?

该记录已经存在为什么要用INSERT?

用Update。

insert into <表名> (name) values ('joey') where id=6