본문 바로가기

IT/코딩테스트

[Leetcode] 2356. Number of Unique Subjects Taught by Each Teacher

728x90

https://leetcode.com/problems/number-of-unique-subjects-taught-by-each-teacher/

SELECT 
  teacher_id, 
  COUNT(DISTINCT(subject_id)) as cnt 
FROM Teacher 
GROUP BY teacher_id;
728x90