LeetCode/Ritコード-Classes More Than 5学習者-MySQL


質問する



に答える

  • there is a table courses with coluns: student and class
  • please list out all classes which have more than or equal to 5 students.
  • for example, the table.
  • 検索

    -- leetcode, Classes More Than 5 Students, mysql
    SELECT class
    FROM courses
    GROUP BY class
    HAVING COUNT(DISTINCT student) >= 5

    結果




    ソース&ハーブ


    leetcode
    github