Skip to content

Instantly share code, notes, and snippets.

@rjp
Created September 21, 2010 08:44
Show Gist options
  • Save rjp/589409 to your computer and use it in GitHub Desktop.
Save rjp/589409 to your computer and use it in GitHub Desktop.
scribot=# select * from (select count(distinct url) as c, date_trunc('hour', wh) as x from url group by x) as q order by c desc limit 20;
c | x
----+------------------------
35 | 2010-03-24 11:00:00+00
26 | 2009-10-28 10:00:00+00
25 | 2009-10-06 10:00:00+01
24 | 2009-10-07 12:00:00+01
24 | 2004-05-05 12:00:00+01
23 | 2004-01-29 12:00:00+00
22 | 2004-11-17 10:00:00+00
22 | 2009-04-15 10:00:00+01
22 | 2010-03-15 14:00:00+00
22 | 2005-12-05 14:00:00+00
22 | 2008-10-24 11:00:00+01
21 | 2008-09-03 10:00:00+01
21 | 2009-11-16 11:00:00+00
21 | 2010-01-15 14:00:00+00
20 | 2009-05-05 10:00:00+01
20 | 2009-03-02 12:00:00+00
20 | 2009-09-11 14:00:00+01
20 | 2004-11-30 17:00:00+00
20 | 2007-04-30 10:00:00+01
20 | 2005-07-20 16:00:00+01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment