表字段ID NAME TIME AMOUNT14502 1111 0201 1
14502 1111 0201 5
14502 2222 0201 4
14502 1111 0201 2
14502 2222 0201 3
14502 1111 0201 2
14502 2222 0201 5
14502 1111 0201 2
14502 1111 0202 3
14502 1111 0202 1
14502 1111 0202 2想取出不同的ID NAME TIME 的最大的AMOUNT值。
即
ID NAME TIME AMOUNT
14502 1111 0201 5
14502 2222 0201 5
14502 1111 0202 3可是我写的句子
max group by 不对 max partition by 也不对、、谢谢帮助~!
14502 1111 0201 5
14502 2222 0201 4
14502 1111 0201 2
14502 2222 0201 3
14502 1111 0201 2
14502 2222 0201 5
14502 1111 0201 2
14502 1111 0202 3
14502 1111 0202 1
14502 1111 0202 2想取出不同的ID NAME TIME 的最大的AMOUNT值。
即
ID NAME TIME AMOUNT
14502 1111 0201 5
14502 2222 0201 5
14502 1111 0202 3可是我写的句子
max group by 不对 max partition by 也不对、、谢谢帮助~!
解决方案 »
- 修改sga_max_size后引起的oracle问题;假启动
- MERGE INTO 在11g中的疑问。谢谢
- 如何在oracle包中一次写入多张图片
- 有关XA事务和ORA-01460
- oracle sql developer使用过程中的字符问题
- WinXP 下装的 oracle 10i: 如何让能使用xp系统的任何帐户进不了Oracle?
- 求助:ADO方式oracle参数化查询出错,提示未传入参数
- 这个update语句怎么在oracle中实现? 急啊! -_-!
- 怎么处理"ORA-00955: 名称已被现有对象占用"的错误
- proc中使用游标的疑问,请指教
- [求助] oracle无法启动
- decode(sign(score-60),-1,'fail','pass')中的各个参数代表什么意思?
from table
group by ID, NAME ,TIME
(
select 14502 a, 1111 b, '0201' c, 1 d from dual
union all
select 14502, 1111, '0201', 5 from dual
union all
select 14502, 2222, '0201', 4 from dual
union all
select 14502, 1111, '0201', 2 from dual
union all
select 14502, 2222, '0201', 3 from dual
union all
select 14502, 1111, '0201', 2 from dual
union all
select 14502, 2222, '0201', 5 from dual
union all
select 14502, 1111, '0201', 2 from dual
union all
select 14502, 1111, '0202', 3 from dual
union all
select 14502, 1111, '0202', 1 from dual
union all
select 14502, 1111, '0202', 2 from dual
)
select a,b,c,max(d) from test
group by c,b,a
order by c,b,a
--result:14502 1111 0201 5
14502 2222 0201 5
14502 1111 0202 3