SQL 강좌 13.SQL SELECT MIN and MAX

The SQL MIN() and MAX() Functions

MIN()함수는 선택된 column에서 가장 작은 값을 반환한다.

MAX()함수는 선택된 column에서 가장 큰 값을 반환한다.

MIN() Syntax

SELECT MIN(column_name)
FROM table_name
WHERE condition;

MAX() Syntax

SELECT MAX(column_name)
FROM table_name
WHERE condition;

MIN() Example

SELECT MIN(Price) AS SmallestPrice
FROM Products;

MAX() Example

SELECT MAX(Price) AS LargestPrice
FROM Products;

Comments