易截截图软件、单文件、免安装、纯绿色、仅160KB

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


相关问答:

oracle sql developer 查询显示中文乱码

环境:1.win2003server+oracle9i
2.oracle9i字符集为AMERICAN_AMERICA.WE8ISO8859P1
3.oracle sql developer版本 1.5.5
现象描述: 1.在sql developer 中查询oracle中的某个表,中文全部显示为乱码。 ......

PHP 连接Oracle 出错

<?php
  getenv("ORACLE_HOME");
  $conn=ocilogon("test","test","test_db");
  if($conn)  
  echo success;  
&nb ......

oracle与sqlserver的参数格式不一致,麻烦

如果一个程序想支持sqlserver与oracle数据库的话。除了dbhelper类需要改变之外,参数传递也是个问题。

sqlserver的参数前缀是 “@”,而oracle是 “:”

请问有没有什么通用解决方法?我不想一个select ......

请教关于oracle的自定义函数的问题

create or replace function GetWorkBeginTime()
  return date is
  myDate    date;
begin
  myDate := trunc(sysdate-1)+8/24;
  return myDate;
end;

......

ORACLE数据库中的 group by 语句?

  with adod_dict do
    begin
    close;
    commandtext:='select bgqxcode,count(*) wjsl from wscl_wsda_file where wjnd=:tnd group by bgqxcode'; ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号