mysql中給表中插入數據,一般使用insert into。
但是在插入數據時,有時會根據條件來插入數據,比如insert into t_person(num,name) values(1,'lily') where true;
會提示語法錯誤。把where true去除掉,可以正確執行。因為一般的insert into 語句是不能帶where條件的。
可以insert into 表名(, , , ,) select *from 表名 where條件表達式
mysql中給表中插入數據,一般使用insert into。
但是在插入數據時,有時會根據條件來插入數據,比如insert into t_person(num,name) values(1,'lily') where true;
會提示語法錯誤。把where true去除掉,可以正確執行。因為一般的insert into 語句是不能帶where條件的。
可以insert into 表名(, , , ,) select *from 表名 where條件表達式
本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。