oracle中sql不可以查询出某字段相同值最多的字段.涉及到业务逻辑筛选了.
①.、查询某字段的值,对比如果相同保存起来
select * from
(select
a.*,
row_number() over (partition by a.col_a order by create_ts desc) as rn
from table1 a )
where rn = 1;
-- table1 换成你的表, col_a 换成你的分组列, create_ts 是你的时间戳字段, 如果是字符串需转换为date
方法 select name, count(name) from t group by name
having count(name)=
(select max(a.cou) from (select count(name) as cou from t group by name) a )
以上就是土嘎嘎小编为大家整理的oracle怎么求最多相关主题介绍,如果您觉得小编更新的文章只要能对粉丝们有用,就是我们最大的鼓励和动力,不要忘记讲本站分享给您身边的朋友哦!!