Re: [SQL] SQL - histogram

2001-07-16 Thread Mathew White
One way to do this is to use the 'CASE' expression, documented here: http://pgsql.dbexperts.com.br/devel-corner/docs/postgres/functions-conditional.html Because you have only one record per person, you can use the 'COUNT' aggregate function to see how many of each height category match. An examp

Re: [SQL] SQL - histogram

2001-07-11 Thread Richard Huxton
From: "Txugo" <[EMAIL PROTECTED]> > 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 >>

[SQL] SQL - histogram

2001-07-10 Thread Txugo
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 > 1