欧美一级特黄大片做受成人-亚洲成人一区二区电影-激情熟女一区二区三区-日韩专区欧美专区国产专区

mysql如何統(tǒng)計每個專業(yè)分數段的人數

MySQL如何統(tǒng)計每個專業(yè)分數段的人數的呢?下面由創(chuàng)新互聯(lián)小編給大家詳細的介紹;

創(chuàng)新互聯(lián)公司專業(yè)為企業(yè)提供井陘網站建設、井陘做網站、井陘網站設計、井陘網站制作等企業(yè)網站建設、網頁設計與制作、井陘企業(yè)網站模板建站服務,10年井陘做網站經驗,不只是建網站,更提供有價值的思路和整體網絡服務。

1.我的表結構

student_info
| id |name |profession|score|
|--|--|--|--|
|id|姓名|分數|專業(yè)|

2.按分數段統(tǒng)計

400到500人數,300到400人數

select
count(case when score between 400 and 500 then 1 end) as 400到500,
count(case when score between 300 and 400 then 1 end) as 300到400
from student_info;

mysql如何統(tǒng)計每個專業(yè)分數段的人數

3.按分數段和專業(yè)統(tǒng)計

400到500人數,300到400人數

select
count(case when score between 400 and 500 then 1 end) as 400到500,
count(case when score between 300 and 400 then 1 end) as 300到400
from student_info GROUP BY profession;

mysql如何統(tǒng)計每個專業(yè)分數段的人數

4.sql動態(tài)拼接生成

  int start = 200;
        int end = 700;
        int inter = 10;
        int count = (end-start)/inter;
        StringBuilder sqlBuilder = new StringBuilder();
        sqlBuilder.append("select ");
        for(int i =1;i<=count;i++){
            int next = start+inter-1;
            System.out.println(start + " \t" + next);
            sqlBuilder.append(" count(case when admission_score between ").append(start).append(" and ").append(next).append(" then 1 end) as ").append(start).append("到").append(next);
            if(i!=count){
                sqlBuilder.append(", ");
            }
            start += inter;
        }
        sqlBuilder.append(" from z_student_info");
        System.out.println(sqlBuilder.toString());

5.輸出sql

select  count(case when admission_score between 200 and 209 then 1 end) as 200到209,  count(case when admission_score between 210 and 219 then 1 end) as 210到219,  count(case when admission_score between 220 and 229 then 1 end) as 220到229,  count(case when admission_score between 230 and 239 then 1 end) as 230到239,  count(case when admission_score between 240 and 249 then 1 end) as 240到249,  count(case when admission_score between 250 and 259 then 1 end) as 250到259,  count(case when admission_score between 260 and 269 then 1 end) as 260到269,  count(case when admission_score between 270 and 279 then 1 end) as 270到279,  count(case when admission_score between 280 and 289 then 1 end) as 280到289,  count(case when admission_score between 290 and 299 then 1 end) as 290到299,  count(case when admission_score between 300 and 309 then 1 end) as 300到309,  count(case when admission_score between 310 and 319 then 1 end) as 310到319,  count(case when admission_score between 320 and 329 then 1 end) as 320到329,  count(case when admission_score between 330 and 339 then 1 end) as 330到339,  count(case when admission_score between 340 and 349 then 1 end) as 340到349,  count(case when admission_score between 350 and 359 then 1 end) as 350到359,  count(case when admission_score between 360 and 369 then 1 end) as 360到369,  count(case when admission_score between 370 and 379 then 1 end) as 370到379,  count(case when admission_score between 380 and 389 then 1 end) as 380到389,  count(case when admission_score between 390 and 399 then 1 end) as 390到399,  count(case when admission_score between 400 and 409 then 1 end) as 400到409,  count(case when admission_score between 410 and 419 then 1 end) as 410到419,  count(case when admission_score between 420 and 429 then 1 end) as 420到429,  count(case when admission_score between 430 and 439 then 1 end) as 430到439,  count(case when admission_score between 440 and 449 then 1 end) as 440到449,  count(case when admission_score between 450 and 459 then 1 end) as 450到459,  count(case when admission_score between 460 and 469 then 1 end) as 460到469,  count(case when admission_score between 470 and 479 then 1 end) as 470到479,  count(case when admission_score between 480 and 489 then 1 end) as 480到489,  count(case when admission_score between 490 and 499 then 1 end) as 490到499,  count(case when admission_score between 500 and 509 then 1 end) as 500到509,  count(case when admission_score between 510 and 519 then 1 end) as 510到519,  count(case when admission_score between 520 and 529 then 1 end) as 520到529,  count(case when admission_score between 530 and 539 then 1 end) as 530到539,  count(case when admission_score between 540 and 549 then 1 end) as 540到549,  count(case when admission_score between 550 and 559 then 1 end) as 550到559,  count(case when admission_score between 560 and 569 then 1 end) as 560到569,  count(case when admission_score between 570 and 579 then 1 end) as 570到579,  count(case when admission_score between 580 and 589 then 1 end) as 580到589,  count(case when admission_score between 590 and 599 then 1 end) as 590到599,  count(case when admission_score between 600 and 609 then 1 end) as 600到609,  count(case when admission_score between 610 and 619 then 1 end) as 610到619,  count(case when admission_score between 620 and 629 then 1 end) as 620到629,  count(case when admission_score between 630 and 639 then 1 end) as 630到639,  count(case when admission_score between 640 and 649 then 1 end) as 640到649,  count(case when admission_score between 650 and 659 then 1 end) as 650到659,  count(case when admission_score between 660 and 669 then 1 end) as 660到669,  count(case when admission_score between 670 and 679 then 1 end) as 670到679,  count(case when admission_score between 680 and 689 then 1 end) as 680到689,  count(case when admission_score between 690 and 699 then 1 end) as 690到699 from z_student_info

以上就是mysql如何統(tǒng)計每個專業(yè)分數段人數的詳細介紹,如果想了解更多請關注創(chuàng)新互聯(lián)其它相關文章!

當前文章:mysql如何統(tǒng)計每個專業(yè)分數段的人數
鏈接URL:http://aaarwkj.com/article40/gjipho.html

成都網站建設公司_創(chuàng)新互聯(lián),為您提供網站排名、全網營銷推廣、搜索引擎優(yōu)化、網站制作云服務器、Google

廣告

聲明:本網站發(fā)布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內容未經允許不得轉載,或轉載時需注明來源: 創(chuàng)新互聯(lián)

手機網站建設
人妻少妇被猛烈进入久久精品| 精品亚洲午夜久久久久| 91看看午夜福利视频| 国产精品国产三级国产专播精品 | 亚洲欧美一区日韩尤物| 成人性生交大片免费看多人| 日本加勒比系列在线播放| 欧美一区二区三区爽| 国语对白刺激真实精品| 日本区一区二区三视频 | 熟妇高潮一区二区三区| 91啪在线观看91色| 国产精品午夜福利91| 亚洲男人的天堂久久精品| 久久中文字幕人妻熟av| 在线观看日韩精品电影| 国内揄拍国内精品少妇国| 日韩不卡免费一区二区三区视频| 日本东京热二三四区不卡免费的| 日韩亚洲天堂视频免费观看| 亚洲欧洲中文字幕一区二区| 国产自拍精品视频免费观看| 国产精品综合久久蜜臀av| 欧美伊人久久大综合精品| 99精品久久久中文字幕日本| 一区二区三区熟妇人妻视频| 亚洲综合中文字幕精品| 一个人看的视频天堂色| 蜜臀av在线精品国自产拍| 亚洲欧美精品成人一区| 国产综合永久精品日韩鬼片| 偷拍丝袜美腿在线观看| 麻豆国产av巨做国产剧情| 欧美十日本亚洲激情视频| 韩国成人伦理片在线观看| 国产精品麻豆久久av| 亚洲情色精品国产一区| 国产青草视频免观看视频| 亚洲,日韩,欧美久久综合| 97国产精品亚洲精品| 日韩在线欧美在线一区二区|