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

Re: histogram

From: Joel Reymont <joelr1(at)gmail(dot)com>
To: Thomas Markus <t(dot)markus(at)proventis(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: histogram
Date: 2011-04-30 17:00:34
Message-ID: CCB32F11-A209-46E1-BE44-2CE4127A2822@gmail.com (view raw or flat)
Thread:
Lists: pgsql-general
What is the meaning of 
	
	group by 1 order by 2

e.g. what to the numbers 1 and 2 stand for?

What would change if I do the following?

	group by 1 order by 1

On Apr 30, 2011, at 5:48 PM, Thomas Markus wrote:

> Hi,
> 
> try something like this:
> 
> select
>    trunc(random() * 10.)/10.
>    , count(*)
> from
>    generate_series(1,2000000)
> group by 1 order by 2

--------------------------------------------------------------------------
- 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: Joel ReymontDate: 2011-04-30 17:03:34
Subject: Re: histogram
Previous:From: Joel ReymontDate: 2011-04-30 16:53:11
Subject: Re: histogram

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