delete from table a where a.B=(select B from table where B=min(B) group by B); 如果B是有序牌的话; 执行两次
11:11:02 SQL> select * from t;A B --- ---------- a 10 a 20 a 30 b 1 b 2 b 3 b 4 c 11 c 12 c 13已选择10行。已用时间: 00: 00: 00.60 11:11:20 SQL> select a,b from ( 11:11:25 2 select a,b,rank() over (partition by a order by rowid asc) rk from t 11:11:25 3 ) 11:11:25 4 where rk>2;A B --- ---------- a 30 b 3 b 4 c 13已用时间: 00: 00: 00.40
select a,b from (select a,b,row_number() over(partition by a order by b) rn from tablename) where rn > 2
如果B是有序牌的话;
执行两次
--- ----------
a 10
a 20
a 30
b 1
b 2
b 3
b 4
c 11
c 12
c 13已选择10行。已用时间: 00: 00: 00.60
11:11:20 SQL> select a,b from (
11:11:25 2 select a,b,rank() over (partition by a order by rowid asc) rk from
t
11:11:25 3 )
11:11:25 4 where rk>2;A B
--- ----------
a 30
b 3
b 4
c 13已用时间: 00: 00: 00.40
(select a,b,row_number() over(partition by a order by b) rn from tablename)
where rn > 2