mysql怎么读英语
在MySQL中set⽅法:
ModifyStatement.Set Method 修改语句 set⽅法
Sets key and value. 设置键和值。
php观察者模式实例
由于insert into语句是⼀个插⼊性的语句,所以它的功能要么向指定的表插⼊数据
也许你看到这个SQL语句是正确的,就觉得这样应该也可以:
mysql> mysql> insert into 4a set sname=4ainall.sname;
编写脚本使用if判断
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mysql> insert into 4a set sname=4ainall.sname' at line 1
renderforest
或者这样也可以:
mysql> mysql> insert into 4a set sname="赵六";
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to
dentyour MySQL server version for the right syntax to use near 'mysql> insert into 4a set sname="赵六"' at line 1
然后这样也是不可⽤:
mysql> insert into 4a select * from 4ainall set sname=4ainall.sname;
linux入门系统ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'from 4ainall set sname=4ainall.sname' at line 1
可以看出由于select是作⽤于4inall这个表的,⽽set⽅法也只能在select语句中,这就直接导致set⽅法只能作⽤于4inall这个表,⽽⽆法作⽤于4a这个表。
但是如果我们不⽤select语句的话编译器⼜怎么会知道4inall表中的数据在哪⾥?
显然select是⽤于查的⽽set则是⼀个⽤于改的⽅法,两者⽆法结合在⼀起——insert into set语句当然也不能⽤于将其他表的数据插⼊到原表中了。