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

后端 未结 9 583
醉梦人生
醉梦人生 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 17:50

    MERGE INTO XYZ A
    USING (
    SELECT RID_BIT(B) CHAVE
    FROM XYZ B
    FETCH FIRST 100000 ROWS ONLY) B
    ON RID_BIT(A) = B.CHAVE
    WHEN MATCHED THEN DELETE;

提交回复
热议问题