即使没有成员也显示组 [英] Displaying the groups even though they have no members

查看:122
本文介绍了即使没有成员也显示组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的餐桌上有这种情况:

组1 5位成员
组2成员

问题是,当一个组有0个成员时,其行根本不会显示.我希望它报告它有0个成员.

谢谢..

I have such a situation in my table:

group1 5 members
group2 0 members

The problem is when a group has 0 members its row is not displayed at all. I want it to report that it has 0 members.

Thanks..

推荐答案

只需执行LEFT JOIN,从所有组的列表到生成成员计数的数据.然后只要确保将NULL替换为零即可.
Just perform a LEFT JOIN from your list of all groups to the data that produces your member counts. Then just make sure you replace the NULL with a zero.


这篇关于即使没有成员也显示组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆