doc_id
これは、 が主キーであるテーブルで機能します。
select count(*)+1 from doctor where
exp > (select exp from doctor where doc_id='001');
+------------+
| count(*)+1 |
+------------+
| 2 |
+------------+
しかし、同じ選択クエリを使用してテーブルにフィールドを設定すると、次のエラーが報告されます。
update doctor set rank=
( select count(*)+1 from doctor where
exp > (select exp from doctor where doc_id='001')
) where doc_id='001';
ERROR 1093 (HY000): You can't specify target table 'doctor' for update
in FROM clause
どのターゲット テーブル参照について話しているのか理解できません。誰か説明できますか?