题目描述
leetcode题目:2356. 每位教师所教授的科目种类的数量
Code
select teacher_id, count(distinct subject_id) as cnt
from Teacher
group by teacher_id
反思点:不要想的太复杂了,不要受联合主键(复合主键)的干扰。。。
leetcode题目:2356. 每位教师所教授的科目种类的数量
select teacher_id, count(distinct subject_id) as cnt
from Teacher
group by teacher_id
反思点:不要想的太复杂了,不要受联合主键(复合主键)的干扰。。。