LoginSignup
12
14

More than 5 years have passed since last update.

sqlで度数分布表、ヒストグラムを書くイディオム

Last updated at Posted at 2014-12-11
SELECT 
FLOOR(base_price/1000)*1000 price_floor,
COUNT(1) cnt,
rpad("",floor(count(1)/100),"|")
FROM items GROUP BY price_floor;

ref
http://www.phppro.jp/school/mysql/vol12/3

12
14
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
12
14