select top 50 id,foldername,(select count(*) from KS_Article where tid=ks_class.id and verific=1) as ssum from ks_class where tj=1 and topflag=1 and channelid=1 order by folderorder
要实现这样的功能该如何写sql,我写了一个结果都是0,但是里面是有内容的 select top 50 id,foldername,(select count(*) from ks_Article where (tid=(select id from ks_class where ts like '%ks_class.id%')) and verific=1) as ssum from ks_class where topflag=1 and channelid=1 order by folderorder