mysql> update aos_service_hostname set department_id = aos_server_machine.department_id from aos_server_machine where aos_service_hostname.id = aos_server_machine.host_id;
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 aos_server_machine where aos_service_hostname.id = aos_server_machine.host_' at line 1
觉得没有错误啊,表结构大体的是这样的 mysql> desc aos_service_hostname;
+--------------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+--------------+--------------+------+-----+---------+-------+
| id | int(11) | NO | PRI | NULL | |
| department_id | varchar(255) | YES | | NULL | | mysql> desc aos_server_machine;
+----------------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------------+--------------+------+-----+---------+-------+
| serial_number | varchar(32) | NO | PRI | NULL | |
| host_id | varchar(255) | NO | | NULL | |
| department_id | int(11) | YES | | NULL | |
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 aos_server_machine where aos_service_hostname.id = aos_server_machine.host_' at line 1
觉得没有错误啊,表结构大体的是这样的 mysql> desc aos_service_hostname;
+--------------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+--------------+--------------+------+-----+---------+-------+
| id | int(11) | NO | PRI | NULL | |
| department_id | varchar(255) | YES | | NULL | | mysql> desc aos_server_machine;
+----------------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------------+--------------+------+-----+---------+-------+
| serial_number | varchar(32) | NO | PRI | NULL | |
| host_id | varchar(255) | NO | | NULL | |
| department_id | int(11) | YES | | NULL | |
解决方案 »
- 有没有好点的 数据库空间呢?MySql也行了
- 求在MYSQL调用发送短信的接口的写法
- 求一sql语句
- 关于MYSQL图形界面工具的问题
- 关于linux下直接拷贝myisam类型表备份的问题!!急~~~~~
- 关于mysql的问题,有phpmyadmin管理中,出现了一些奇怪的进程
- 急!!!!mysql起不动了!!!
- 怎样连接jdbc到mysql中?
- MYSQL insert大数据量的问题
- 请问下各位大佬,测试爬虫系统,爬了很多数据新闻回来,我要怎么测试爬过来的数据是否包含要求的关键字
- 求一条SQL语句,更改两个表中的同一字段。两个表用相同ID关联的
- mysql有类似mssql中的checksum命令使得一字符串对应唯一int值没?
set aos_service_hostname.department_id = aos_server_machine.department_id;