SQLize Online / PHPize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
DELETE FROM tbl WHERE id NOT IN ( SELECT id FROM ( SELECT id, ROW_NUMBER() OVER (PARTITION BY code, number ORDER BY id) as rn FROM tbl ) AS numbered_tbl WHERE rn = 1 ); select * from tbl

Stuck with a problem? Got Error? Ask ChatGPT!

Copy Clear