I have `VK_MODIFY` table where i want to delete all the duplicate data by combination of `ORDERID` and `EXTORID` and keep only the one which has latest `SYSTEM_INSERTED_AT`.

[![enter image description here][1]][1]

I have tried below query but its not working correctly:

```
DELETE FROM VK_MODIFY a
WHERE rowid not in
(SELECT min(rowid)
FROM VK_MODIFY b
where a.ORDERID = b.ORDERID and a.EXTORID = b.EXTORID);

```