oracle function MIN ([distinct | all] x)

[Function] statistics table to select rows x columns maximum.

 

Parameters all expressed selecting the maximum value of all values, only demand DISTINCT different maximum values, defaults to all

If there are distinct parameter or all, the need for space-separated with x (column).

 

Parameters x, may be numerals, characters or date fields

 

[Back] x corresponding to the field type

Note: The character fields, Null values ​​are ignored (NULL)

 

[Example]

surroundings:

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;

 

Execution Stats:

select MIN(distinct sal),MIN(xm),MIN(distinct xm),MIN(all xm) from table3;

The results: 0 gao gao gao

Guess you like

Origin www.cnblogs.com/fanweisheng/p/11119560.html