create table s_c(Name varchar(10), Course varchar(10))
insert s_c select 'A', '语文'
union all select 'A', '数学'
union all select 'A', '英语'
union all select 'B', '语文'
union all select 'B', '英语'
union all select 'C', '数学'
union all select 'C', '英语'
select s_c.Name from s_c
inner join
(
select Course from s_c where Name='B'
)B on s_c.Course=B.Course and Name<>'B'
group by s_c.Name
having count(*)>=(select count(*) from s_c where Name='B')