tbl表中有两个字段:name,price
create table tbl(name,varchar2(20),price number(10));
delete from tbl where rowid not in(select max(t1.rowid) from tbl t1 group by t1.price);
虽然删除了指定字段中重复的值,但会为其保留最后一个值,也就是说,如果字段中有n条重复的,则第n个将被保留.
tbl表中有两个字段:name,price
create table tbl(name,varchar2(20),price number(10));
delete from tbl where rowid not in(select max(t1.rowid) from tbl t1 group by t1.price);
虽然删除了指定字段中重复的值,但会为其保留最后一个值,也就是说,如果字段中有n条重复的,则第n个将被保留.