mysql中给表中插入数据,一般使用insert into。

但是在插入数据时,有时会根据条件来插入数据,比如insert into t_person(num,name) values(1,'lily') where true;

会提示语法错误。把where true去除掉,可以正确执行。因为一般的insert into 语句是不能带where条件的。

可以insert into 表名(, , , ,) select *from 表名 where条件表达式

posted on 2016-06-28 20:20  言止予思  阅读(5271)  评论(0编辑  收藏  举报