select a.istop,a.name,a.body,a.username,count(b.ReplyID) as countID,a.[browse],b.replytime, b.replyperson
from article a inner join reply b on a.Article=b.ArticleID order by a.istop desc,a.dateandtime desc
from article a inner join reply b on a.Article=b.ArticleID order by a.istop desc,a.dateandtime desc
其中 article.boardid字段决定文章所属板块,在这个页面只取这个板块,即boardid=4的,就是说在where里再加一个条件
column'a.istop' is invalid in the select list because it is not contained in an aggregate function and there is no groutby clause
如果把istop列删了,提示 column'a.name' is invalid.....
如果后面加group by articleID,提示语法错误。加group by a.articleID也不行