|
主题:[求助]继续求助:都一天了(附图)SQL循环调用二级栏目及当前二级栏目文章问题?? [收藏主题] |
singhh4721 发表于:2010/9/1 18:23:00 | 只看该作者 查看该作者主题
楼主
二级栏目的循环调用:
select id,tn,foldername,mid(classbasicinfo,instr(classbasicinfo,"||||")+4) as s,mid(s,1,instr(s,"||||")-1) as 栏目介绍 ,mid(classbasicinfo,1,instr(classbasicinfo,"||||")-1) as 栏目图片 from ks_class where tn='{$CurrClassID}' order by folderorder 栏目文章的循环调用: select ID,Title,KS_hyj,KS_msj,KS_xyj,KS_zhj from KS_Article where tid in({$CurrClassChildID}) and deltf=0 and verific=1 order by id desc 两个SQL语句要怎样结合起来??? 帮帮忙!! |
|
支持(0) | 反对(0) 顶端 底部 |
支持(0) | 反对(0) 顶端 底部 |
而且用联合语句会出错
select top 1 title,id,photourl,intro,adddate,1 as a from ks_article where picnews=1 and recommend=1 and tid='{$Param(0)}' order by adddate desc union all select top 4 title,id,intro,photourl,adddate,2 as a from ks_article where recommend=1 and tid='{$Param(0)}' and id not in(select top 1 id from ks_article where picnews=1 and recommend=1 and tid='{$Param(0)}' order by adddate desc) order by a, adddate desc 这是我网站上的一个联合的,结果不采集最新新闻,永远是之前那几条。红色加粗来链接 |
|
支持(0) | 反对(0) 顶端 底部 |
<上一主题 | 下一主题 > |