select top 13 * from Article where classid=9 and newsid not in(select top 3 newsid from Article where classid=9 order by ontop desc,rq desc) order by ontop desc,rq desc
简单吧!!!
本文介绍了一种使用SQL进行数据检索的方法,通过一个具体的示例展示了如何从特定类别中选择记录,并排除最近选择过的几条记录,确保数据的多样性和新鲜感。
select top 13 * from Article where classid=9 and newsid not in(select top 3 newsid from Article where classid=9 order by ontop desc,rq desc) order by ontop desc,rq desc
简单吧!!!

被折叠的 条评论
为什么被折叠?