By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
CREATE TABLE test SELECT 1 id UNION SELECT 2 UNION SELECT 3;
SELECT * FROM test;
Records: 3 Duplicates: 0 Warnings: 0
id |
---|
1 |
2 |
3 |
DELETE t1
FROM test t1
JOIN test t2 ON t2.id > t1.id;
SELECT * FROM test;
id |
---|
3 |