프로그래머스 > 코딩테스트 연습 > SQL 고득점 Kit
https://programmers.co.kr/learn/challenges
https://programmers.co.kr/learn/courses/30/lessons/59414
코딩테스트 연습 - DATETIME에서 DATE로 형 변환
ANIMAL_INS 테이블은 동물 보호소에 들어온 동물의 정보를 담은 테이블입니다. ANIMAL_INS 테이블 구조는 다음과 같으며, ANIMAL_ID, ANIMAL_TYPE, DATETIME, INTAKE_CONDITION, NAME, SEX_UPON_INTAKE는 각각 동물의 아이디
programmers.co.kr
2014-08-08 04:20:00 ▶ 2014-08-08
DATE_FORMAT(DATETIME, '%Y-%m-%d')
%Y => 2014
%y => 14
%M => August
%m => 08
%D => 8th
%d => 08
https://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html#function_date-format
MySQL :: MySQL 5.7 Reference Manual :: 12.7 Date and Time Functions
12.7 Date and Time Functions This section describes the functions that can be used to manipulate temporal values. See Section 11.2, “Date and Time Data Types”, for a description of the range of values each date and time type has and the valid formats
dev.mysql.com
'노트1 > SQL' 카테고리의 다른 글
[SQLite] solvesql 문제풀이 : date(), time(), datetime(), 배송 누락 택배건 조회 (0) | 2022.02.10 |
---|---|
[SQLite] solvesql 문제풀이 : substr(), upper(), 올림픽 개최 도시 조회 (0) | 2022.02.10 |
[MySQL] 프로그래머스 문제풀이 : IFNULL(), NVL(), CASE문 (0) | 2022.02.10 |
[MySQL] 프로그래머스 문제풀이 : GROUP BY, WITH RECURSIVE (재귀) (0) | 2022.02.10 |
[MySQL] LeetCode 문제풀이 : CASE문 테이블피봇 (1179. Reformat Department Table) (0) | 2021.12.21 |