프로그래밍 공부/SQL

[SQL] 년, 월, 일 데이터 추출하기 - YEAR(), MONTH(), DAY()

hueco 2022. 10. 30.

 

 

날짜 형식의 칼럼에서 년, 월, 일 데이터를 추출하고 싶을 때는 YEAR(), MONTH(), DAY()를 사용한다.

 

🔍️ 문법:

# CASE : MYSQL
YEAR(날짜 형식의 값)
MONTH(날짜 형식의 값)
DAY(날짜 형식의 값)

 

🚀 예제:

 

🏷️ Reference:

 - 문법 설명: https://www.w3schools.com/sql/func_mysql_year.asp

 

MySQL YEAR() Function

W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.

www.w3schools.com

 

- 관련 문제 : https://school.programmers.co.kr/learn/courses/30/lessons/131535

 

프로그래머스

코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.

programmers.co.kr

 
 
 
 

댓글