第二次求一条
表A 
 id                           name                           paix                  shijian                     biaoti 
 1                              公司1                              1                     2007/5/20                  标题1 
 2                              公司1                              1                     2007/5/20                  标题2 
 3                              公司2                              2                     2007/5/20                  标题3 
 4                              公司2                              2                     2007/5/20                  标题4 
 5                              公司3                              0                     2007/5/20                  标题5 
 6                              公司4                              0                     2007/5/20                  标题6 
 7                              公司5                              0                     2007/5/20                  标题7 
 意思是把公司2和公司1排到第一二位而且同一个公司只显示他的一条记录,其余的记录按id从大到小排序   
 哪位高手能给出一条sql语句???
------解决方案--------------------declare @a table(id int, name varchar(10), paix int, shijian smalldatetime, biaoti varchar(10)) 
 insert @a select 1 , '公司1 ', 1 , '2007/5/20 ',  '标题1 ' 
 union all select 2 , '公司1 ', 1 , '2007/5/20 ',  '标题2 ' 
 union all select 3 , '公司2 ', 2 , '2007/5/20 ',  '标题3 ' 
 union all select 4 , '公司2 ', 2 , '2007/5/20 ',  '标题4 ' 
 union all select 5 , '公司3 ', 0 , '2007/5/20 ',  '标题5 ' 
 union all select 6 , '公司4 ', 0 , '2007/5/20 ',  '标题6 ' 
 union all select 7 , '公司5 ', 0 , '2007/5/20 ',  '标题7 '   
 select * from @a a where not exists(select 1 from @a where name=a.name and id <a.id)   
 --result 
 /* 
 id          name       paix      shijian             biaoti      
 ---------- --------- ---------- --------------       ----------  
 1           公司1        1       2007-05-20 00:00:00   标题1 
 3           公司2        2       2007-05-20 00:00:00   标题3 
 5           公司3        0       2007-05-20 00:00:00   标题5 
 6           公司4        0       2007-05-20 00:00:00   标题6 
 7           公司5        0       2007-05-20 00:00:00   标题7   
 (所影响的行数为 5 行) 
 */
------解决方案--------------------select * from 表 as T 
 where id =(select min(id) from 表 where name=T.name)