Skip to content

Instantly share code, notes, and snippets.

@nfarah86
Created October 23, 2020 18:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nfarah86/52754379f36add4526960082f19f6ea3 to your computer and use it in GitHub Desktop.
Save nfarah86/52754379f36add4526960082f19f6ea3 to your computer and use it in GitHub Desktop.
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