George Eric R Contr AFSPC/CVYZ writes:

> Is there any function/command/neat query that you can use to get a histogram
> of a column's values?  I didn't find anything in the manual or the DuBois
> book.

GROUP BY does the trick, as long as you can make an expression
that converts any value into the number of its box. A simple
example would be
SELECT FLOOR(col1/10), COUNT(*) FROM table1 GROUP BY FLOOR(col1/10)

//C

-- 
 Carl Troein - Círdan / Istari-PixelMagic - UIN 16353280
 [EMAIL PROTECTED] | http://pixelmagic.dyndns.org/~cirdan/
 Amiga user since '89, and damned proud of it too.


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

  • Histogram? George Eric R Contr AFSPC/CVYZ
    • Carl Troein

Reply via email to