mysql錯誤用法insert into 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刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM