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 of rows deleted in an SQL request.
Basically I want to do this with DB2 :
DELETE FROM table WHERE info = '1' LIMIT 1
Is there a way to do that with DB2 ?
On IBMi DB2:
If your primary key has multiple values, or you just need multiple values as the condition, this is the query that works:
How is this query?
Just select a statement, and put the statement inside the delete query: