--try 
select 字段 from 表
group by 字段
where having count(字段)>1

解决方案 »

  1.   

    declare @t table(id int,name varchar(10)) 
    insert into @t
    select '1','a' union all
    select '1','b' union all
    select '1','c' union all
    select '2','e' union all
    select '3','f' union all
    select '3','g' 
    ------------------------------
    select * from 
    (select id from @t 
    group by id having count(*)>1) a
    left join @t b
    on a.id=b.id
    id          id          name       
    ----------- ----------- ---------- 
    1           1           a
    1           1           b
    1           1           c
    3           3           f
    3           3           g(影響 5 個資料列)