SQLize Online / PHPize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
create table tbl ( id int, code text, number int ); insert into tbl (id, code, number) values (1, 'A', 21), (2, 'B', 23), (2, 'B', 23), (4, 'D', 22), (5, 'E', 25), (6, 'G', 26), (5, 'E', 25); delete FROM tbl where id not in( SELECT id, code, number, ROW_NUMBER() OVER(PARTITION BY code, number ORDER BY id) dell FROM tbl) as inq WHERE dell = 1; select * from tbl

Stuck with a problem? Got Error? Ask ChatGPT!

Copy Clear