Skip to content

Instantly share code, notes, and snippets.

@workmaster2n
Created November 14, 2013 00:18
Show Gist options
  • Select an option

  • Save workmaster2n/7459021 to your computer and use it in GitHub Desktop.

Select an option

Save workmaster2n/7459021 to your computer and use it in GitHub Desktop.
count distinct date
SELECT DISTINCT ON (date_trunc('day', recorded_at)) COUNT(*)
FROM tracked_points WHERE worker_id = 1 AND recorded_at > '2013-11-14'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment