分析函数
select no,
eno,
max(name) keep(dense_rank first order by sal) over(partition by no) as 最小值,
max(name) keep(dense_rank last order by sal) over(partition by no) as 最大值,
name,
sal
from tabname
where eno=1
order by 1,6 desc;
也可食用first_value和last_value
first_value(name) over(partition by no order by sal desc) as 最大值
或者
last_value(name) over(partition by no order by sal) as 最大值