select *
from (
select top (@count1) a.* from article as a with (nolock)
left join article_type as at with (nolock)
on a.articletype=at.articletypeid
where a.isdelete=0 and a.status=0
and at.articletypeid=@articletype1—条件变换
and a.issuetime<getdate()
order by a.issuetime desc,a.articletype asc
) t
union all
select *
from (
select top (@count2) a.* from article as a with (nolock)
left join article_type as at with (nolock)
on a.articletype=at.articletypeid
where a.isdelete=0 and a.status=0
and at.articletypeid=@articletype2—条件变换
and a.issuetime<getdate()
order by a.issuetime desc,a.articletype asc
) t
union all
select *
from (
select top (@count3) a.* from article as a with (nolock)
left join article_type as at with (nolock)
on a.articletype=at.articletypeid
where a.isdelete=0 and a.status=0
and at.articletypeid=@articletype3 —条件变换
and a.issuetime<getdate()
order by a.issuetime desc,a.articletype asc
) t
多个结果集union后保持各自原有排序
•
生活家
赞 (0)
SQL server数据库创建代码,filegroup文件组修改,
上一篇
2022年3月21日
哪种合婚方法最准确,你知道合婚有几种方法吗
下一篇
2022年3月21日