LeetCode/릿코드-Classes More Than 5 Students-MySQL

1470 단어 leetcodeleetcode

문제

풀이

  • 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

좋은 웹페이지 즐겨찾기