MIN – Return minimum value of selected column – Aggregate Functions

MIN function returns the minimum value of selected column.
The value can be number, character, or datetime.

example: Return the smallest salary of employees.

SELECT MIN(salary) FROM tbEmpTable;

MIN(salary)
---------------------------
120000

example: Return the smallest salary in each department.

SELECT deptCD, MIN(salary) FROM tbEmpTable
GROUP BY deptCD;

deptCD,          MIN(salary)
----------------------------
100               120000
200               156000
300               240000
400               350000

Posted in Aggregate Functions