LEAST

DB2 (9.5 onward), MySQL, Oracle, and PostgreSQL implement the LEAST function to return the smallest value from a list of values:

LEAST(value [, value ...])

The input values may be numbers, datetimes, or strings.

Get SQL Pocket Guide, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.