1
我想寫這種說法在SQLAlchemy的/ Postgres的:如何在SQLAlchemy中使用UPDATE ... FROM?
UPDATE slots
FROM (SELECT id FROM slots WHERE user IS NULL
ORDER BY id LIMIT 1000) AS available
SET user='joe'
WHERE id = available.id
RETURNING *;
即,我想更新匹配指定條件的行的數量有限。
PG
向下投票,因爲這不回答問題。 – 2016-05-10 07:21:14