Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Binning data
SELECT COUNT(*) FROM <table_name> WHERE <column_name> >= 50 AND
<column_name> <=100 ??? for each range, or is this what you're trying to
avoid?
James Petts wrote:
> Hi
>
> I have a series of real numbers, and I want to bin the data by ranges,
> and get a count of the number of values in each bin. The values range
> from 75.1 to 1200.4, and I want to bin them in steps of fifty. Thus, I
> want to count all values between 50.0001 and 100.0000, between
> 100.0001 and 150.0000, etc., all the way up to the range from
> 1200.0001 to 1250.0000.
>
> Can anybody suggest an easy way to do this in SQL or do I need to
> resort to PL/SQL?
>
> James Petts
Received on Mon Apr 26 1999 - 17:33:55 CDT
![]() |
![]() |