求一条查询语句?
调出一条推荐新闻,我的第一条sql是:sql= "select top 1 * from news where best=-1 order by id desc "
在再下面掉出除了这条推荐新闻以外的
sql= "select top 7 * from news where id not in(select top 1 id from news where best=-1) order by id desc "
怎么还是出现上面推荐的那一条呢,应该怎么写啊 。》
------解决方案--------------------没必要那么烦,只要选择7条,输出时控制就可以了
你让它输出什么就输出什么
------解决方案--------------------sql= "select top 7 * from news where id not in(select top 1 id from news where best=-1 order by id desc) order by id desc "