oracle group by 中 select 后只能写聚集函数或group by 后的之列。
select * from (
select id,row_number() over(partition by mygroup order by myorder) as num from table_name
) t1 where t1.num = 1;
取各组中的number one。
oracle group by 中 select 后只能写聚集函数或group by 后的之列。
select * from (
select id,row_number() over(partition by mygroup order by myorder) as num from table_name
) t1 where t1.num = 1;
取各组中的number one。