본문 바로가기
Engineering WIKI/Database

[MySQL] 날짜 조회

by wonos 2020. 3. 9.

DATE() 함수

SELECT id, post_date FROM wp_posts2 WHERE DATE(post_date)='2012-01-22';

BETWEEN() 함수

SELECT id, post_date FROM wp_posts2 WHERE DATE(post_date) BETWEEN '2012-01-22' AND '2012-01-23';