最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

categories - How to create a table with counts of category combinations?

programmeradmin0浏览0评论

I have two main 'groups' of categories. I would like to have a table on a certain page that contains counts for the number of posts with combinations of categories from these two groups. So for instance, if my first groups contains categories 'A', 'B', 'C' and my second group contains categories 'X', 'Y', 'Z', I'd like to have a table like

   |     X     |     Y     |     Z     |
 A | count(AX) | count(AY) | count(AZ) |
 B | count(BX) | count(BY) | count(BZ) |
 C | count(CX) | count(CY) | count(CZ) |

with count(AX) meaning the number of posts that have both category A and category X.

How would I best go about this?

发布评论

评论列表(0)

  1. 暂无评论