Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Histogram Procedure/Function

Re: Histogram Procedure/Function

From: Joseph Amalraj <joseph_at_amalrajinc.com>
Date: Fri, 10 Mar 2006 12:07:16 -0800 (PST)
Message-ID: <20060310200716.99242.qmail@web412.biz.mail.mud.yahoo.com>


You could create a table with    

  fields    

  range_limit_name 
  lower_limit
  upper_limt
   

  and join this table with table_name with numeric_value    

  where clause can have condition where   numeric_value between lower_limit and upper_limit    

  group by the range_limit_name    

  Joseph Amalraj

Ethan Post <post.ethan_at_gmail.com> wrote:

    I am looking for the easiest way to take a select and transform into some sort of histogram...    

  select numeric_value from table_name;    

  should come back as    

  range             total
  1-10                30
  11-20              100

  ...    

  Guessing I could create a temp table and actually have oracle generate a histogram for me then pull that back but wondering if there is a simple function or procedure I can use. Thinking about this as I type so I apogise if the answer turns out to be somewhat obvious.    

  Thanks,
  Ethan        

--
http://www.freelists.org/webpage/oracle-l
Received on Fri Mar 10 2006 - 14:07:16 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US