我需要获取特定时间段的数据。目前,我只能根据日期获取数据。如何获取相同日期范围但时间范围为下午3-5点的数据?
SELECT
event_name,
COUNT(DISTINCT user_pseudo_id) as uniques,
COUNT(user_pseudo_id) as total
FROM
`XYZ.analytics_123.events_*`
WHERE
app_info.install_source = "iTunes"
AND (Extract (DATE FROM TIMESTAMP_MICROS( user_first_touch_timestamp )) between "2020-05-20" and
"2020-05-20")
AND (_TABLE_SUFFIX between "20200520" AND "20200520")
GROUP BY
event_name
1条答案
按热度按时间6ju8rftf1#
你可以用
EXTRACT(HOUR FROM TIMESTAMP_MICROS(user_first_touch_timestamp )) BETWEEN 15 AND 17
如下例所示