1 20070903 2944
2 20070903 132
3 20070903 1463
4 20070903 10461
5 20070903 4306
6 20070904 5130
7 20070904 801
8 20070904 665
9 20070904 4844
10 20070904 4589
11 20070904 3314
12 20070905 1871
13 20070905 1453
14 20070905 55
15 20070905 50
16 20070906 110
17 20070906 5121
18 20070906 1351
19 20070907 20359
20 20070907 10462
21 20070908 0
22 20070908 5545有这么一张表:我想求每天,数值最大的两位之和
2 20070903 132
3 20070903 1463
4 20070903 10461
5 20070903 4306
6 20070904 5130
7 20070904 801
8 20070904 665
9 20070904 4844
10 20070904 4589
11 20070904 3314
12 20070905 1871
13 20070905 1453
14 20070905 55
15 20070905 50
16 20070906 110
17 20070906 5121
18 20070906 1351
19 20070907 20359
20 20070907 10462
21 20070908 0
22 20070908 5545有这么一张表:我想求每天,数值最大的两位之和
解决方案 »
- 求一句子翻译
- oracle中如何给一个字段赋多个值?
- 针对Oracle数据库在ADO中,为何对recordset结果集的field的property属性值做以下修改时会出现错误"Operation is not allowed in this cont
- sequence--伪值
- 高分求:Oracle(Windows环境下)的安全备份策略!!!
- 关于触发器的疑问
- 请高手指点:在一个数据量比较大的系统中,怎样让系统自动保存近两年的数据?而无需维护!
- 如何配置oracle监听多个端口?
- 哪位大神帮我看看这条sql!!!
- 【sqldbx v4.3】 连接Oracle时提示Failed to load x86 Oracle Client (oci.dll) from:
- 关于数据库中date类型
- ORACLE 存储过程返回记录的问题?
假设表为a,字段 id date numselect date,sum(num) num
from (
select a.*,row_number() over(partition by date order by num desc) rn
from a)
where rn<=2
group by date
两品牌和:
select date, sum(num) num
from (select a.*,
row_number() over(partition by date order by num desc) rn
from a)
where rn <= 2
group by date
两品牌被五整除:
select date, num / 5 num
from (select a.*,
row_number() over(partition by date order by num desc) rn
from a)
where rn <= 2;
from (select date, sum(num) sumNum
from (select date,
num,
row_number() over(partition by 日期 order by num desc) rn
from a)
where rn <= 2
and rn
group by date)
where mod(sumNum, 5) = 0;
select sumNum
from (select date, sum(num) sumNum
from (select date,
num,
row_number() over(partition by date order by num desc) rn
from a)
where rn <= 2
and rn
group by date)
where mod(sumNum, 5) = 0;
oracle 中取余 用的是 mod,
select sumNum
from (select date, sum(num) sumNum
from (select date,
num,
row_number() over(partition by date order by num desc) rn
from a)
where rn <= 2
and rn
group by date)
where mod(sumNum, 5) = 0;
oracle 中取余 用的是 mod,