ORACLE 取最大值
表字段
ID NAME TIME AMOUNT
14502 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 也不对、、
谢谢帮助~!
select ID, NAME ,TIME,max(amount) amount
from table
group by ID, NAME ,TIME
with test as
(
select 14502 a, 1111 b, '0201' c, 1 d from dual
union al
相关问答:
环境:1.win2003server+oracle9i
2.oracle9i字符集为AMERICAN_AMERICA.WE8ISO8859P1
3.oracle sql developer版本 1.5.5
现象描述: 1.在sql developer 中查询oracle中的某个表,中文全部显示为乱码。
......
<?php
getenv("ORACLE_HOME");
$conn=ocilogon("test","test","test_db");
if($conn)
echo success;
&nb ......
如果一个程序想支持sqlserver与oracle数据库的话。除了dbhelper类需要改变之外,参数传递也是个问题。
sqlserver的参数前缀是 “@”,而oracle是 “:”
请问有没有什么通用解决方法?我不想一个select ......
create or replace function GetWorkBeginTime()
return date is
myDate date;
begin
myDate := trunc(sysdate-1)+8/24;
return myDate;
end;
......
with adod_dict do
begin
close;
commandtext:='select bgqxcode,count(*) wjsl from wscl_wsda_file where wjnd=:tnd group by bgqxcode'; ......