How do I LIMIT the number of rows in a DELETE with DB2?

后端 未结 9 585
醉梦人生
醉梦人生 2021-01-11 17:09

I want to add a security on a sensitive table when I delete lines with an SQL request on a DB2 table.

I want to mimic the way MySQL allows you to limit the numbers o

9条回答
  •  终归单人心
    2021-01-11 18:00

    How is this query?

    delete from table D where exists 
     ( select * from ( select * from table M fetch first 10 rows only ) as M
       where M.object_id = D.object_id )
    

提交回复
热议问题