|
- select top 4 brandname, photourl,recommend from KS_classbrand where id in (select a.id from KS_classbrand a left join KS_classbrandr b on a.id=b.brandid where b.classid in(select id from ks_class where left(CAST(ts AS nvarchar (20)),14)='这里是顶级栏目id') group by a.id) and recommend=1
循环体这里就不写了吧!你懂得!O(∩_∩)O~
|