LintCode MySQL 1932/1933. 挂科最多的同学 I / II
生活随笔
收集整理的這篇文章主要介紹了
LintCode MySQL 1932/1933. 挂科最多的同学 I / II
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
文章目錄
- 1. 題目
- 2. 解題
1. 題目
exams 表中存放著同學(xué)們的考試記錄
請(qǐng)用 SQL 語句,找到掛科數(shù)最多的同學(xué)所對(duì)應(yīng)的 student_id
https://www.lintcode.com/problem/1932
2. 解題
-- Write your SQL Query here -- -- example: SELECT * FROM XX_TABLE WHERE XXX -- select student_id from (select sum(if(is_pass=0, 1, 0)) ct, student_id from examsgroup by student_idhaving ct > 0order by ct desclimit 1 ) t- LintCode 1933, 掛科數(shù)目最多的同學(xué) 有多位
我的CSDN博客地址 https://michael.blog.csdn.net/
長按或掃碼關(guān)注我的公眾號(hào)(Michael阿明),一起加油、一起學(xué)習(xí)進(jìn)步!
總結(jié)
以上是生活随笔為你收集整理的LintCode MySQL 1932/1933. 挂科最多的同学 I / II的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: MapReduce 计算框架如何运作
- 下一篇: LeetCode MySQL 1571.