1.根据ROWID保留1条数据
DELETE FROM TEST WHERE ROWID NOT IN (SELECT MIN(ROWID) FROM TEST GROUP BY ID);
2.根据日期保留最新1条数据
DELETE FROM TEST
WHERE ROWID NOT IN (
SELECT ROWID
FROM (
SELECT ROWID, ROW_NUMBER() OVER (PARTITION BY ID ORDER BY TIMESTAMP DESC) AS rnum
FROM TEST
) WHERE rnum = 1
);