每天學習一點點 編程PDF電子書免費下載: http://www.shitanlife.com/code
cast(starttime as date): 時間轉日期類型
實例SQL:
SELECT
COUNT (ID) AS pvNum,
COUNT (DISTINCT userid) AS userNum,
cast(starttime as date) AS staDay
FROM
t_e_visit_record
WHERE true
AND starttime >= '2018-03-20'
GROUP BY
cast(starttime as date)
