Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
SELECT CAST(d.day AS string) as "day",
SUM(d.steps) as "steps"
FROM production.daily_steps d
JOIN production.users u
ON d.userId = u._id
WHERE
d.day >= PARSE_DATE_ISO8601('2020-09-09') AND
d.day <= PARSE_DATE_ISO8601('2020-09-13') AND
u.appType = 3
AND (u.subSegmentId = 1914)
AND d.userId = '1'
GROUP BY d.day
ORDER BY day
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment