有一个 ORM 生成的 SQL,如下所示:
SELECT * FROM "games" WHERE "competition_id" IN
(SELECT "id" FROM "competitions" WHERE "id" IN (1,2,3))
ORDER BY "date" LIMIT 10
它显示第 1 到 10 行。
然而之后:
UPDATE "games" SET "season_id"=2
同样SELECT
返回行,如 1,2,3 ... 11, 12 而不是 1,2,3 ... 9, 10
是的,返回的行仍然是 10,但最后一行总是替换为 10 之后的行......