select * from table t
where exists(select 1 
                from table 
                   where 姓名=t.姓名 
                          and 分数<>t.分数)

解决方案 »

  1.   

    --建立表結構
    create table tb([name] nvarchar(10),point float)--插入測試數據
    insert into tb
    select 'A', 60 union        
    select 'A', 60 union       
    select 'B', 70 union      
    select 'B', 80 union       
    select 'C', 80 union       
    select 'C', 90 union       
    select 'C', 90 union       
    select 'D', 80 union       
    select 'D', 80--查詢
    select distinct a.[name] 
    from tb a,tb b
    where a.[name]=b.[name]
              and a.point <> b.point--結果
    /*
       name
        B
        C
    */--刪除表
    drop table tb
      

  2.   

    呵呵 
    vivianfdlpw() 的速度快,效率高
      

  3.   

    select * from tablename t
    where (select 1 from tablename where 姓名=t.姓名 and 分数<>t.分数)>0
      

  4.   

    select distinct a.xm,a.fs from 表名 a,表名 where a.fs<>qq.fs and a.xm=qq.xm