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

cosmos·2021년 9월 23일
0
post-thumbnail
post-custom-banner

문제

풀이

  • 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

post-custom-banner

0개의 댓글