Oracle Greatest()函数

简介: GREATEST The GREATEST function returns the largest expression in a list of expressions. All expressions after the first are implicitly converted to the data type of the first expression bef

GREATEST

The GREATEST function returns the largest expression in a list of expressions. All expressions after the first are implicitly converted to the data type of the first expression before the comparison.

To retrieve the smallest expression in a list of expressions, use LEAST.

Return Value

The data type of the first expression.

Syntax

GREATEST (expr [, expr]...)

Arguments

expr

An expression.

Examples

Example 16-3 Finding the Longest Text Expressions

The following statement selects the longest string.

SHOW GREATEST ('Harry', 'Harriot', 'Harold')
Harriot

Example 16-4 Finding the Largest Numerical Expression

The following statement selects the number with the greatest value.

SHOW GREATEST (5, 3, 18)
18
原文地址:点击打开链接
目录
相关文章
|
3月前
|
SQL Oracle 算法
|
3月前
|
SQL Oracle 关系型数据库
|
3月前
|
SQL Oracle 关系型数据库
Oracle|内置函数之INSTR
【7月更文挑战第5天】
|
3月前
|
Oracle 关系型数据库 数据挖掘
|
5月前
|
SQL Oracle 关系型数据库
JAVAEE框架数据库技术之12_oracle常用函数和高级查询子查询
JAVAEE框架数据库技术之12_oracle常用函数和高级查询子查询
107 0
JAVAEE框架数据库技术之12_oracle常用函数和高级查询子查询
|
3月前
|
Oracle 关系型数据库 数据挖掘
|
5月前
|
存储 Java 数据库
JAVAEE框架数据库技术之13_oracle 之PLSQL技术及存储过程和函数(二)
JAVAEE框架数据库技术之13_oracle 之PLSQL技术及存储过程和函数
73 0
|
4月前
|
存储 Oracle NoSQL
Oracle中decode函数详解
Oracle中decode函数详解
|
4月前
|
Oracle 关系型数据库 大数据
oracle递归函数
oracle递归函数
|
5月前
|
NoSQL Oracle 关系型数据库
MongoDB与Oracle:管道函数兼容之道
【4月更文挑战第20天】
51 2