oracle怎么筛选行的最大值,oracle取最大值那一行

oracle 求某一列最大值,其他列的值

你是要求某一列中最大值,然后查询最大值这一行的其他列值,是吧。

创新互联主营万柏林网站建设的网络公司,主营网站建设方案,重庆APP软件开发,万柏林h5小程序制作搭建,万柏林网站营销推广欢迎万柏林等地区企业咨询

就是嵌套查询就行,先查最大值,然后再用这个最大值作为条件就可以了。

类似于下面的语句

select * from table where id=(select max(id) from table)

可能需要很多变动,比如需要分组求最大,然后查询出每组的那一行数据,这就需要对这个语句进行一些修改了(用开窗函数rank()over()然后嵌套查询也可以,这个可以自由选择)(以下内容分仅为举例,长时间没这么写了,具体的写法忘记了,可能要进行些修改才能用)

select * from table where id||id_1 in (select id||max(id_1) from table group by id )

oracle里面怎么选取最大值?

select name

from EMPLOYEE

where date=(select max(date) from EMPLOYEE);

---

以上,希望对你有所帮助。

oracle中选出某个字段里面最大值的记录的sql语句怎么写

1、创建测试表,

create table test_max(id number, value number);

2、插入测试数据

insert into test_max values(1,12);

insert into test_max values(2,100);

insert into test_max values(3,55);

insert into test_max values(4,100);

insert into test_max values(5,50);

commit;

3、查询表中全量数据,select t.*, rowid from test_max t;

4、编写sql,使用rank分析函数,取value值为最大的记录; select t.* from (select t.*, rank() over(order by value desc) rk from test_max t) t where rk = 1;


网站题目:oracle怎么筛选行的最大值,oracle取最大值那一行
链接分享:http://scyanting.com/article/dschpjh.html