数据如下:
A列 B列
A 1
B 32
C 11
D 22
E 6
A 33
B 111
F 2我要的结果是去除重复的A列值,而且B列最小的保留,然后排序显示出来
结果如下:
A列 B列
A 1
F 2
E 6
C 11
D 22
B 32
A列 B列
A 1
B 32
C 11
D 22
E 6
A 33
B 111
F 2我要的结果是去除重复的A列值,而且B列最小的保留,然后排序显示出来
结果如下:
A列 B列
A 1
F 2
E 6
C 11
D 22
B 32
解决方案 »
- 我的xp系统上装的oracle 10g,oracledbconsoleorcl服务不能启动,请教大虾
- Toad for Oracle 韩文乱码问题
- 写了一个函数,测试的时候总报ORA-00933,求指教
- 如何将code转换成数据库中的content
- oracle在局域网内客户端连接和服务器经常断线
- 一个B/S结构ERP系统,出入库单据超过100万条,系统在单据调出、保存过程中速度比较慢,原因可能有哪些?有哪些办法可以提高速度?
- oracle 的trunc函数
- 不同表空间的表数据查询
- ORA-27101
- oracle的数据库驱动程序是否可以单独安装,怎么用别的打包程序(如:installshield)将它打包进去?
- 请问oracle 数据库与数据库之间怎么通信
- 求助:有关oracle的em页面显示问题
group by A
order by b
from table
group by A
with tmp as
(
select 'A' cola, 1 colb from dual union all
select 'B' cola, 32 colb from dual union all
select 'C' cola, 11 colb from dual union all
select 'D' cola, 22 colb from dual union all
select 'E' cola, 6 colb from dual union all
select 'A' cola, 33 colb from dual union all
select 'B' cola, 111 colb from dual union all
select 'F' cola, 2 colb from dual
)
select cola,min(colb) from tmp
group by cola
order by 2;COLA MIN(COLB)
---- ----------
A 1
F 2
E 6
C 11
D 22
B 32
A varchar2(10), B number);
insert into testA
select 'A',1 from dual union all
select 'B',32 from dual union all
select 'C',11 from dual union all
select 'D',22 from dual union all
select 'E',6 from dual union all
select 'A',33 from dual union all
select 'B',111 from dual union all
select 'F',2 from dual;
select * from (select A,B,rank() over(partition by A order by B) n from testA) tt where tt.n<=1 order by tt.B;