select [CollegeID],[CollegeName],(select count(BlogTitle) from Bloges as b where BlogEnable=1 andb.CollegeID=Colleges.CollegeID) as countBlog from [Colleges] order by countBlog desc
修改前select [CollegeID], [CollegeName],(select count(BlogTitle) from Bloges as b where BlogEnable=1 andb.CollegeID=Colleges.CollegeID) as countBlog from [Colleges] order by countBlog desc修改后select Colleges.[CollegeID], Colleges.[CollegeName],count(b.BlogTitle) as countBlog from