mysql 날짜 범위 검색
SELECT * FROM table
WHERE regdate between date_sub(now(), interval 3 month) and now()
이런식으로 3개월 전부터 현재까지의 데이터를 조회.
regdate 컬럼은 timestamp, datetime 이고 인덱스가 걸려있다.
hobbiez – 취미생활 블로그.
SELECT * FROM table
WHERE regdate between date_sub(now(), interval 3 month) and now()
이런식으로 3개월 전부터 현재까지의 데이터를 조회.
regdate 컬럼은 timestamp, datetime 이고 인덱스가 걸려있다.