我正在做我的最后一个项目,这是返回所有 id、姓名和日期列表的查询。
select
c.id as id, i.full_name as n, day as d
from
(instructors i
inner join courses c ON c.instructor_id = i.id)
inner join exam_schedules e ON c.id = e.course_id
结果示例:
id name day
9977 SCOTT, RAYMOND C. wednesday
9467 FERNANDEZ, CYNTHIA E. wednesday
9468 FERNANDEZ, CYNTHIA E. wednesday
9493 FERNANDEZ, CYNTHIA E. wednesday
9538 STEPHENS, RONNIE T. wednesday
9539 MYERS, RONNIE Y. wednesday
9554 GARRISON, EUGENE A. wednesday
如何获取所有 ID 的列表和 name+day 组合的计数?
上面的例子应该产生:
9977 1
9467 3
9468 3
9493 3
9538 1
9539 1
9554 1