当我在 DB2 表上删除带有 SQL 请求的行时,我想在敏感表上添加安全性。
我想模仿 MySQL 允许限制 SQL 请求中删除的行数的方式。
基本上我想用 DB2 来做到这一点:
DELETE FROM table WHERE info = '1' LIMIT 1
有没有办法用 DB2 做到这一点?
最佳答案
delete from table where id in (select id from table where info = '1' order by id fetch first 1 rows only)
关于sql - 如何使用 DB2 限制 DELETE 中的行数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1062988/