select * from
(
select t2.f1, t2.y1, t2.y2, t2.random, rank() over(partition by t2.f1 order by t2.random) rank from
(
select t1.分组号 f1, t1.样本标记1 y1, t1.样本标记2 y2, dbms_random.value random from table_name t1
) t2
)
where rank <= 100
;
select * from
(
select t2.f1, t2.y1, t2.y2, t2.random, rank() over(partition by t2.f1 order by t2.random) rank from
(
select t1.分组号 f1, t1.样本标记1 y1, t1.样本标记2 y2, dbms_random.value random from table_name t1
) t2
)
where rank <= 100
;