试试
select top 10 a.id,title,adddate,num,intro from ks_article a,(select infoid,count(*) as num from ks_comment where channelid=1 group by infoid)b where a.id=b.infoid order by b.num desc
循环体
<script src="/ks_inc/digg.js" language="javascript"></script>
[loop=2]
<table width="100%" border="0">
<tr>
<td width="80" rowspan="4">
<div style="width:61px;text-align:center;background:url(/images/diggbg.gif) #FFF no-repeat;height:68px;">
<div style="padding-top:8px;">
<span id="s{$Field(id,GetInfoUrl,1,2)}" style="font-weight:bold;"></span><br /><span>人支持</span> </div>
<div style="padding-top:8px;" id="d{$Field(id,GetInfoUrl,1,2)}"><a href="javascript:digg(1,{$Field(id,GetInfoUrl,1,2)},'/');">顶一下</a></div>
</div>
<script language="javascript">show_digg(1,{$Field(id,GetInfoUrl,1,2)},'/');</script>
</td>
<td><a href="{$Field(id,GetInfoUrl,1,1)}" target="_blank"><font style="color:#ff6600;font-size:14px;">{$Field(title,Text,0,...,0,)}</font></a></td>
</tr>
<tr>
<td>{$Field(intro,Text,250,...,2,)}</td>
</tr>
</table>
<div style="border-bottom:1px dashed #999999;"></div>
[/loop]