PostgreSQLNumeric FunctionsGREATEST
DIV

GREATESTNumeric Functions

LEAST

Returns the largest value from a list.

Syntax

GREATEST(v, ...)

Example

Enter values below to update the example in real time.

order_id
qty_a
qty_b
qty_c
max_qty
multi_channel_orders
SELECT order_id, GREATEST(qty_a, qty_b, qty_c) AS max_qty
FROM multi_channel_orders;