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

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免费在线观看麻豆| 五月婷婷丁香在线观看| 国产在线91精品入口| 综合久久久精品国产亚洲av| 午夜激情在线观看国产| 日韩精品熟妻人女亚洲一区| 日韩精品精美视频在线观看 | 国产91在线视频播放| 国产三级在线视频不卡| 成人性生交大片免费看中文 | 亚洲欧美国产日韩另类| 九九热这里只有免费视频| 亚洲乱码一区二区av| 白天躁晚上躁天天躁在线| 国产日韩欧美高清免费视频| 一区二区高清免费日本| 五月婷婷亚洲激情综合网| 免费黄色福利网址大片| 亚洲一区二区中文字幕av| 在线中文字幕日韩有码| 日本少妇熟女一区二区| 日本中文字幕一区在线观看| 国产亚洲黄片免费在线观看| 蜜臀一区二区三区精品免费| 中国女人内射69xx| 伊人久久综在合线亚洲| 成熟女人毛茸茸的视频| 国产av超爽剧情系列| 中文国产人精品久久蜜桃| 人妻少妇系列一区二区 | 精品中文字幕欧美区一区| 日本黄色大波少妇网站| 亚洲国产精品一区二区av不卡| 中文字幕乱码亚洲2019| 高清免费在线自偷自拍| 亚洲三级黄片免费播放| 亚洲精品一区二区三区高潮| 欧美大吊视频在线观看|