PostgreSQLNumeric FunctionsLEAST
GREATEST

LEASTNumeric Functions

WIDTH_BUCKET

Returns the smallest value from a list.

Syntax

LEAST(v, ...)

Example

Enter values below to update the example in real time.

price_online
price_store
price_app
best_price
products
SELECT LEAST(price_online, price_store, price_app) AS best_price
FROM products;