반응형
data의 5분단위 등록수를 추출하기 위함.
SELECT
CAST(UNIX_TIMESTAMP(날짜컬럼)/300 AS SIGNED)
,FROM_UNIXTIME(CAST(UNIX_TIMESTAMP(날짜컬럼)/300 AS SIGNED)*300) AS tDate
,COUNT(*) cnt FROM TB_NAME
WHERE 날짜컬럼 BETWEEN '검색일자 00:00:00' AND '검색일자 23:59:59' GROUP BY 1
반응형