Access中多种类型的产品按照某类产品优先排序

先上查询语句:

select top 8 * from
(select 1 as [id],[title],file_path,[image] from [article] where ArticleType=2 and id<>952 and pid=(select top 1 pid from [article] where ArticleType=2 and id=952) and view_yes=1 union all select top 8 2 as [id],[title],file_path,[image] from [article] where ArticleType=2 and id<>952 and pid<>(select top 1 pid from [article] where ArticleType=2 and id=952) and view_yes=1) aa

查询结果:

实际效果:

当前查询的产品是:新一代财务软件普及版,

页面最下方是相关产品

网址链接:

原文地址:https://www.cnblogs.com/azhe127/p/3443841.html