ここで何が起こっているのか理解できません。次のクエリで、rand_id
テーブル内のレコード5394560のクエリが、テーブル内の同じレコードのentities
に一致するように更新されることを期待しています。代わりに9に更新されますか?!?!?rand_id
unique_ids
mysql> update entities, unique_ids SET entities.rand_id = unique_ids.rand_id where entities.id=5394560;
Query OK, 1 rows affected (2.74 sec)
Rows matched: 1 Changed: 1 Warnings: 0
結果の確認:
mysql> select * from entities where id=5394560;
+---------+------------------+---------+---------------------+
| id | name | rand_id | created_at |
+---------+------------------+---------+---------------------+
| 5394560 | Andorra la Vella | 9 | 2013-03-15 13:58:38 |
+---------+------------------+---------+---------------------+
1 row in set (0.00 sec)
mysql> select * from unique_ids where id=5394560;
+---------+----------+
| id | rand_id |
+---------+----------+
| 5394560 | 26543652 |
+---------+----------+
1 row in set (0.00 sec)
ここで完全に単純で愚かなものが欠けていますか?!?!?両方のテーブルの両方の列がを使用してint(11)
いるので、データ型の最大値に問題はないと思いますが、間違っている可能性があります...