日期:2014-05-18 浏览次数:20570 次
--测试数据 declare @artitle table (Title varchar(4),addtime datetime) insert into @artitle select 'aaa1','2010-09-09' union all select 'aaa2','2010-09-05' union all select 'bbb1','2010-09-01' union all select 'bbb3','2010-09-02' union all select 'ccc1','2010-09-04' union all select 'ccc4','2010-09-05' select * from ( SELECT TOP 10 Title FROM @artitle WHERE Title like '%aaa%' ORDER BY addTime DESC ) aa union select * from ( SELECT TOP 10 Title FROM @artitle WHERE Title like '%bbb%' ORDER BY addTime DESC ) bb /* Title ----- aaa1 aaa2 bbb1 bbb3 */