问题描述
selecta.ID,a.Title,count(b.QuestionsId)asancountfromWeb_QuestionsainnerjoinWeb_Answerbona.ID=b.QuestionsIdgroupbya.ID,a.Title,a.QuestionsIdorderbycount(a.QuestionsId)desc
解决方案
解决方案二:
fromainWeb_QuestionsjoinbinWeb_Answerona.ID=b.QuestionsIdselectnew{...}.orderby...ThenBy
解决方案三:
结帖率:0%
解决方案四:
varquery=fromaindb.Web_Questionsjoinbindb.Web_Answerona.IDequalsb.QuestionsIdgroupabynew{a.ID,a.Title,a.QuestionsId}intogorderbyg.Count(x=>x.QuestionsId)descendingselectnew{g.Key.ID,g.Key.Title,ancount=g.Count(x=>x.QuestionsId)};
时间: 2025-01-21 04:36:39