标签: sql-server tsql
如何在表staff_schedule
结果如下:
答案 0 :(得分:1)
如果您需要限制计数< = 8
select schedule.schedule_id, count(*) from schedule inner join staff_schedule on schedule.schedule_id = staff_schedule.schedule_id group by schedule_id having count(*) <= 8