Skip to main content
GREATEST

Returns the greatest value among the given columns (i.e., arguments)

Updated over a year ago

Description

The GREATEST() function identifies and returns the largest value from a set of columns (i.e., arguments) provided. It's useful for determining maximum values within datasets or scenarios where you need to select the highest value.

Syntax

GREATEST(arg1, arg2, ...)

Output

number

Variables

  1. arg1, arg2, ...: The numeric values or columns you want to compare to find the greatest value.

Example

GREATEST(Quantity Sold - NY`,`Quantity Sold - Boston,``Quantity Sold - Newark`)

Product

Quantity Sold - NY

Quantity Sold - Boston

Quantity Sold - Newark

GREATEST

Product A

150

140

20

150

Product B

280

320

50

320

Product C

500

100

320

500

Product D

90

120

320

320

Product E

120

30

20

120

Did this answer your question?