用where子句插入多列

时间:2019-04-20 07:03:59

标签: sql-server

插入具有where条件的多列数据时,出现错误

insert into s_grpeffect(grpeffect_cess, grpeffect_rcm, grpeffect_fulllife)
values ('12.0000', '12.0000', '2019') 
where grpeffect_grpkid = 124;

1 个答案:

答案 0 :(得分:0)

您不能为插入语句添加where子句。

insert into s_grpeffect(grpeffect_cess,grpeffect_rcm,grpeffect_fulllife) values('12.0000','12.0000','2019') 

或者,如果您要从表格中选择值,则语法如下,

INSERT INTO table2
SELECT * FROM table1
WHERE condition;