如何获取一个特定的多个帖子 [英] how to fetch multiple posts of a particular
本文介绍了如何获取一个特定的多个帖子的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好,
我有两个表:Blog和Comment
我想获取每个博客显示的评论数.
谁能告诉我对此的选择查询是什么?
谢谢
Hello there,
I have two tables : Blog and Comment
I want to fetch the number of comments for display of each blog.
Can anyone tell me what can be the select query for this?
Thank you
推荐答案
我建议您从此处开始 [ ^ ].
Wes是正确的,除非您想对所有人进行计数,否则它
选择count(comment),blog中的博客b内部加入注释c按博客分组(任意)
I would suggest you start here[^].
Wes is correct, unless you want to get a count for all, then it''s
select count(comment), blog from blog b inner join comment c on (whatever) group by blog
这篇关于如何获取一个特定的多个帖子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文