본문 바로가기
IT/SQL

3] SQL 프로그래머스 최댓값 구하기

by 깻잎쌈 2020. 11. 3.
반응형

 SELECT MAX(DATETIME) AS 시간 
 FROM ANIMAL_INS 
 ORDER BY DATETIME DESC;
SELECT DATETIME AS 시간
FROM ANIMAL_INS 
ORDER BY DATETIME DESC 
LIMIT 1;

www.w3schools.com/sql/sql_min_max.asp

 

SQL MIN() and MAX() Functions

SQL MIN() and MAX() Functions The SQL MIN() and MAX() Functions The MIN() function returns the smallest value of the selected column. The MAX() function returns the largest value of the selected column. MIN() Syntax SELECT MIN(column_name) FROM table_name

www.w3schools.com

 

반응형

댓글