一个复杂变态的查询问题!
假如我有一张表,表名test,有3个字段c1,c2,type 
 数据如下 
                               c1         c2            type 
    第1行            a               9            5 
    第2行            b               8            5 
    第3行            c               7            6 
    第4行            d               6            6 
    第5行            e               5            7   
       现在我要写个查询语句,类型相同的数据,只要显示一行就可以了, 
       也就是上面的数据只要显示第1行,第3行,第5行!如下: 
                               c1         c2            type 
                               a               9            5 
                               c               7            6 
                               e               5            7 
       这查询语句该怎么写? 
       想了很久想不明白,郁闷ing
------解决方案----------------------@Test 
 declare @test table(c1 varchar(1),c2 int,type int) 
 insert @test 
 select  'a ',9,5 union all 
 select  'b ',8,5 union all 
 select  'c ',7,6 union all 
 select  'd ',6,6 union all 
 select  'e ',5,7   
 select * from @test a where c1=(select top 1 c1 from @Test where type=a.type) 
 /* 
 c1	c2	type 
 a	9	5 
 c	7	6 
 e	5	7 
 */
------解决方案--------------------select * from test a where c1=(select top 1 c1 from test where type=a.type)