mysql sql語句 查詢文章表,評論表(根據評論表文章評論次數排序查詢出文章count(),group,left join)

需求:spa 表1,文章表,3d 表2,評論表,blog 第一種實現方式:it         SELECT a.id,a.title,a.content,a.type_id,count(b.id) as d  from message as a LEFT JOIN  comment as b on a.id=b.id GROUP BY b.id ORDER BY d  desc im 第二種實現
相關文章
相關標籤/搜索