select name from bm a group by name having  
not exists
(
select 1 from bm where name='小陈' and pno not in (select pno from bm where name = a.name)
)

解决方案 »

  1.   

    select name from yourtb as a
    where not exists 
    ( select 1 from yourtb as b 
          where b.name = '小陈' and a.pno <> b.pno )
      

  2.   

    select name 
    from bm  
    where pno in(select pno from bm where name='小陈')
    group by name 
    having count(*)=(select count(*) from bm where name='小陈')
      

  3.   

    select distinct name from bm a
    where not exists (
    select 1 from bm where name='小陈' and pno not in (select pno from bm where name = a.name)
    )
      

  4.   

    select a.name 
    from bm a
    ,(select pno from bm where name='小陈')b
    ,(select cnt=count(*) from bm where name='小陈')c
    where a.pno=b.pno
    group by a.name,c.cnt
    having count(*)>=c.cnt
      

  5.   

    select a.name 
    from bm a,(select pno from bm where name='小陈')b
    where a.pno=b.pno
    group by a.name
    having count(*)>=(select cnt=count(*) from bm where name='小陈')