看板 Database 關於我們 聯絡資訊
※ 引述《bluehaerts (5858笨58)》之銘言: : table a : class_id score : c01 100 : c01 80 : c01 70 : c01 85 : c01 88 : c01 75 : c01 70 : 我用 select count(score) : from a : where '8%' : 可是這樣不行耶 請問我是哪邊需要修改阿 謝謝各位高手的回答 SELECT COUNT(score) FROM class_s where score BETWEEN '80' AND '89' and class_id = 'c01 ' 我已經會把80-89分的資料抓出來了 現在我重點是 我要怎麼下GROUP BY 的指令 因為我想 每10分當1個區間 抓出資料有幾筆 SELECT FLOOR(score/10),COUNT(FLOOR(score/10)) FROM class_s where cid = 'c01 ' group by FLOOR(score/10) 恩 我去找了FLOOR來用 就可以了 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.134.140.40
kylekai:除以10就好了 06/16 14:55
bluehaerts:請問一下 哪邊除以10 SCORE 我除過不能 06/16 15:08
※ 編輯: bluehaerts 來自: 140.134.140.40 (06/16 15:33)