PostgreSQL

PostgreSQL MIN and MAX

Find the smallest and largest non-null values in a column.

Find minimum and maximum

SELECT MIN(year) AS first_year,
       MAX(year) AS latest_year
FROM products;

MIN and MAX are aggregate functions. They return one result for the whole table or one result per group when used with GROUP BY.