데이타베이스

MYSQL 날짜와 시간별 데이타 뽑아내기

세이박스 2008. 10. 9. 23:48
반응형
SELECT ex_no, from_unixtime(`reg_date`,'%Y%m%d%H') as hh,
COUNT(ex_no) AS `cnt_reg_date`
FROM expose_log
Where from_unixtime(reg_date,'%Y%m%d%H') >= '04050406'
AND from_unixtime(reg_date,'%Y%m%d%H') <= '04050723'
GROUP BY from_unixtime(`reg_date`,'%Y%m%d%H'), `ex_no`
ORDER BY from_unixtime(`reg_date`,'%Y%m%d%H')
반응형