Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28]) by postgresql.org (8.11.3/8.11.1) with SMTP id f6ALCCa14746 for ; Tue, 10 Jul 2001 17:12:12 -0400 (EDT) (envelope-from pgsql-sql-owner@postgresql.org) Received: from news.tht.net (news.hub.org [216.126.91.242]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f6A2tRa85121 for ; Mon, 9 Jul 2001 22:55:27 -0400 (EDT) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.11.4/8.11.4) id f6A2hPh04107 for pgsql-sql@postgresql.org; Mon, 9 Jul 2001 22:43:25 -0400 (EDT) (envelope-from news) From: msalt@uol.com.br (Txugo) X-Newsgroups: comp.databases.postgresql.sql Subject: SQL - histogram Date: 9 Jul 2001 10:19:49 -0700 Organization: http://groups.google.com/ Lines: 14 Message-ID: <45809a56.0107090919.177def5b@posting.google.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Complaints-To: groups-support@google.com To: pgsql-sql@postgresql.org X-Archive-Number: 200107/125 X-Sequence-Number: 3913 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