日期:2014-05-17  浏览次数:20852 次

求求:合并sql查询语句
select   top   5   *   from   news   where   newstype=1
select   top   5   *   from   news   where   newstype=2
select   top   5   *   from   news   where   newstype=3
select   top   5   *   from   news   where   newstype=4

这四条语句,怎么用一条sql语句来写!




------解决方案--------------------
select top 5 * from news where newstype=1 union all select top 5 * from news where newstype=2 union all select top 5 * from news where newstype=3 ...........