SQL - histogram

From: msalt(at)uol(dot)com(dot)br (Txugo)
To: pgsql-sql(at)postgresql(dot)org
Subject: SQL - histogram
Date: 2001-07-09 17:19:49
Message-ID: 45809a56.0107090919.177def5b@posting.google.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi,
I've a problem as follow:
I have a table where one record represent a person, including his height.
I'd like to know how many person have more than 150 cm, more than 160 cm
and so on.
How can I do that using SQL?

Example:
people > 150 - 1000
> 160 - 850
> 170 - 500
> 180 - 200
> 190 - 30
thanks in advance

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Bruce Momjian 2001-07-09 19:09:41 Re: PGAccess/pgplsql Blues
Previous Message Alvar Freude 2001-07-09 15:45:13 Re: Returning multiple Rows from PL/pgSQL-Function