Skip site navigation (1) Skip section navigation (2)

Re: histogram

From: Rob Sargent <robjsargent(at)gmail(dot)com>
To: Joel Reymont <joelr1(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: histogram
Date: 2011-04-30 18:14:37
Message-ID: 4DBC518D.2090502@gmail.com (view raw or flat)
Thread:
Lists: pgsql-general
re: 1 and 2. They're horrible (imho) reference to the attributes of the 
returned tuple. Or at best an exposure of the implementation. :)

Order by "2" if you want the most frequent (highest counts) of your 
distances at the bottom of the output (or ordery by 2 desc) if you want 
them at the top of your output.

Joel Reymont wrote:
> I think this should do what I want
>
> 	select trunc(distance * 10.)/10., count(*)
> 	from doc_ads
> 	group by 1 order by 1
>
>   Thanks, Joel
>
>
> --------------------------------------------------------------------------
> - for hire: mac osx device driver ninja, kernel extensions and usb drivers
> ---------------------+------------+---------------------------------------
> http://wagerlabs.com | @wagerlabs | http://www.linkedin.com/in/joelreymont
> ---------------------+------------+---------------------------------------
>
>
>
>
>   

In response to

Responses

pgsql-general by date

Next:From: MarkDate: 2011-04-30 18:37:18
Subject: Re: GIN index not used
Previous:From: Tom LaneDate: 2011-04-30 17:29:36
Subject: Re: Short-circuit boolean evaluation

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group