我正在尝试使用 Java Persistence Query Language 对 DB2 表进行批量更新:
UPDATE Account a
SET a.Status = 'r', a.Code = :code, a.Timestamp = CURRENT_TIMESTAMP
WHERE ClientNumber IN (SELECT ClientNumber FROM Account
WHERE a.Status = '' AND a.Type = :type
ORDER BY a.Code ASC
FETCH FIRST 5 ROWS ONLY)
但是,JPQL 似乎不支持FETCH FIRST n ROWS ONLY 。
有哪些其他选择可以做到这一点?