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

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)

手機網站建設
男人自拍天堂在线视频| 色呦呦一区二区三区视频| 国产美女高潮流白浆视频免费看| 国产特级黄片免费观看| 伊在人亚洲香蕉精品区| 日本中文字幕区二区三区电影| 国产三级精品大乳人妇| 国产成人精品久久久亚洲| 人妖一区二区三区在线观看| 我的农村中年激情熟妇| 白白色最新福利视频二| 加勒比东京热视频在线| 国产熟女肥臀精品国产馆乱| 日韩精品成人一区二区三区免费 | 熟女人妻一区二区三区免费看| 欧美一区日韩二区国产三区| 日韩毛片免费看美日韩毛片| 欧美性生活真实的视频| 亚洲欧美日韩之国产综合| 天堂av在线网址观看| 精品人妻系列一区二区| 精品三级黄色国产片| 日韩黄色免费在线观看| 最新免费观看男女啪啪视频 | 字幕日本欧美一区二区| 日韩精品激情视频在线| 国内一级片内射免费视频观看| 人妻有码av中文字幕久久| 亚洲中文字幕av每天更新| 亚洲家庭伦理在线观看| 亚洲综合色一区二区三区四区| 免费在线成人av观看| 亚洲综合av伊人久久| 啊啊…嗯嗯…用力免费观看视频| 亚洲精品一品区二品区三| 97在线视频这里只有精品| 成人国产在线欧美精品| 亚洲一区二区三区久久伊人| 亚洲国产高清国产拍精品| 亚洲欧美日韩乱码综合久久| 尤物在线观看视频播放|