做網(wǎng)站、滕州網(wǎng)站設(shè)計(jì),以傳統(tǒng)方式定制建設(shè)網(wǎng)站,并提供域名空間備案等一條龍服務(wù),秉承以專業(yè)、用心的態(tài)度為用戶提供真誠(chéng)的服務(wù)。我們深信只要達(dá)到每一位用戶的要求,就會(huì)得到認(rèn)可,從而選擇與我們長(zhǎng)期合作。這樣,我們也可以走得更遠(yuǎn)!/>
- -- 解法一
- SELECT
- t1.teacher_no,
- (CASE WEEK WHEN '1' THEN keshu ELSE 0 END ) 禮拜一,
- (CASE WEEK WHEN '2' THEN keshu ELSE 0 END ) 禮拜二,
- (CASE WEEK WHEN '3' THEN keshu ELSE 0 END ) 禮拜三
- FROM
- (
- SELECT
- teacher_no,
- WEEK,
- COUNT(1) AS keshu
- FROM teach
- GROUP BY teacher_no,WEEK
- )t1
- GROUP BY t1.teacher_no;
-
-
- -- 解法二 就是count()函數(shù)作用
- SELECT
- t1.teacher_no,
- (CASE WEEK WHEN '1' THEN keshu ELSE 0 END ) 禮拜一,
- (CASE WEEK WHEN '2' THEN keshu ELSE 0 END ) 禮拜二,
- (CASE WEEK WHEN '3' THEN keshu ELSE 0 END ) 禮拜三
- FROM
- (
- SELECT
- t.teacher_no,
- t.WEEK,
- COUNT(t.keshu) AS keshu
- FROM
- (
- SELECT
- teacher_no,
- WEEK,
- '1' keshu
- FROM teach )t
- GROUP BY teacher_no,WEEK
- )t1
- GROUP BY t1.teacher_no
- ;
當(dāng)前題目:(一)、根據(jù)teacher_no統(tǒng)計(jì)星期的上課數(shù)-創(chuàng)新互聯(lián)
文章鏈接:http://aaarwkj.com/article18/cojsgp.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供軟件開發(fā)、微信公眾號(hào)、網(wǎng)站策劃、關(guān)鍵詞優(yōu)化、外貿(mào)建站、域名注冊(cè)
廣告
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源:
創(chuàng)新互聯(lián)