반응형
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
반응형
'IT > SQL' 카테고리의 다른 글
5] 프로그래머스 동물 수 구하기 (1) | 2020.11.04 |
---|---|
4] 프로그래머스 최솟값 구하기 (0) | 2020.11.04 |
2] 프로그래머스 상위 n개 레코드 (0) | 2020.11.02 |
1] 프로그래머스 여러 기준으로 정렬하기 (0) | 2020.11.02 |
0] 프로그래머스 어린 동물 찾기 (0) | 2020.11.02 |
댓글