Skip to content

Instantly share code, notes, and snippets.

@markuman
Created August 31, 2018 09:37
Show Gist options
  • Save markuman/c404d605e12752f08c8d31772a094b63 to your computer and use it in GitHub Desktop.
Save markuman/c404d605e12752f08c8d31772a094b63 to your computer and use it in GitHub Desktop.
select
created_unix as time_sec,
count(user_id) as value,
'commits_per_day' as metric
from
`action`
where user_id = 1 and $__unixEpochFilter(created_unix)
group by DATE_FORMAT(FROM_UNIXTIME(created_unix), '%Y%m%d')
order by created_unix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment