mysql> select * from biaoa;
+----------+------+-------+
| name | size | count |
+----------+------+-------+
| zhangsan | 100 | NULL |
| lisi | 99 | NULL |
| wangwu | 89 | NULL |
+----------+------+-------+
3 rows in set (0.00 sec)
mysql> select * from biaob;
+----------+--------+
| name | count |
+----------+--------+
| wangwu | 11111 |
| zhangsan | 22222 |
| lisi | 333333 |
+----------+--------+
3 rows in set (0.00 sec)
mysql> update biaoa set count=(select count from biaob where name=biaoa.name);Query OK, 3 rows affected (0.00 sec)
Rows matched: 3 Changed: 3 Warnings: 0
mysql> select * from biaoa;
+----------+------+--------+
| name | size | count |
+----------+------+--------+
| zhangsan | 100 | 22222 |
| lisi | 99 | 333333 |
| wangwu | 89 | 11111 |
+----------+------+--------+
3 rows in set (0.00 sec)
追问我说了不是查询是修改,用select?
其次,a. 是什么意思?
追答对于修改表记录的操作,操作之前记得备份,切记