Skip to content

Instantly share code, notes, and snippets.

@martijngastkemper
Created March 31, 2015 07:00
Show Gist options
  • Select an option

  • Save martijngastkemper/a07a3c8d539ef2873809 to your computer and use it in GitHub Desktop.

Select an option

Save martijngastkemper/a07a3c8d539ef2873809 to your computer and use it in GitHub Desktop.
SELECT u.url, min(time), avg(time), max(time), count(*), VAR_POP(time) , STD(time)
FROM data d LEFT JOIN url u ON u.id = d.url
WHERE `timestamp` > TIMESTAMP(NOW() - INTERVAL 1 DAY)
GROUP BY d.url
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment