【功能】統計數據表選中行x列的最大值。
【參數】all表示對所有的值求最大值,distinct只對不同的值求最大值,默認為all
如果有參數distinct或all,需有空格與x(列)隔開。
【參數】x,可為數字、字符或日期型字段
【返回】對應x字段類型
【示例】
環境:
create table table3(xm varchar(8),sal number(7,2));
insert into table3 values('gao',1111.11);
insert into table3 values('gao',1111.11);
insert into table3 values('zhu',5555.55);
insert into table3 values('',1111.11);
insert into table3 values('zhu',0);
commit;
執行統計:
select MAX(distinct sal),MAX(xm) from table3;
結果:5555.55 zhu