Min()& Max()

$sql = “SELECT MIN(salary) min, MAX(salary) max\n”
. ” FROM `salaries`”;

Description

MySQL MIN function is used to find out the record with minimum value among a record set. MySQL MAX function is used to find out the record with minimum value among a record set.

output

min max
200 400

Advertisements