FOR_MIN()
function is used to search for a minimum in a specific column and return a value related to that minimum from another column.
metric
: must be one of the following data types: INT
, LONG
, FLOAT
, DOUBLE
, DATE
or TIMESTAMP
value
: can be any data type except TEXT
FOR_MIN()
function returns NULL
in the following situations:
metric
column contains only NULL
valuesvalue
corresponding to the metric minimum value is NULL
NaN
(not-a-number) if the input contains a NaN
.
payment
table that stores customer payment records, including any applied discounts:
payments
table content, run the following query:
FOR_MIN()
basic usageFOR_MIN()
with GROUP BY
clauseGROUP BY
clause with FOR_MIN()
function: