Home > Database > Mysql Tutorial > Oracle 多字段取最大/最小值函数

Oracle 多字段取最大/最小值函数

WBOY
Release: 2016-06-07 17:13:50
Original
2711 people have browsed it

Oracle 多字段取最大/最小值函数 一列求最大值、最小值我们知道用max或min; 多列、多字段(不确定字段个数)求最大值、最小值可以

Oracle 多字段取最大/最小值函数

一列求最大值、最小值我们知道用max或min;

多列、多字段(不确定字段个数)求最大值、最小值可以用 greatest 、least;可以传入任一个字段横向求最大值,,比如:

SQL> select greatest(1,2,3,4,5,6) from dual;

GREATEST(1,2,3,4,5,6)

-------------------------------

6

SQL> select least(1,2,3,4,5,6) from dual;

LEAST(1,2,3,4,5,6)

-------------------------------

1

更多Oracle相关信息见Oracle 专题页面 ?tid=12

linux

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template