1、uid、pwd --------user ID、password
2、select column1 ,column2 from tablename a
   where column2=(select top 1 column2 from tablename where a.column2=column2)

解决方案 »

  1.   

    declare @b table(column1 int,column2 varchar(10))
    insert into @b 
    select 1,'a' union
    select 1,'b' union
    select 2,'b' union
    select 2,'c' union
    select 2,'c' union
    select 3,'d' union
    select 3,'f' 
    select column1,column2 
    from @b a
    where column2=(select top 1 column2 from @b where column1=a.column1)
    --结果
    -------------------
    --column1   column2
    --1    a
    --2    b
    --3    d