Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
好的,我已经尝试了 2 天来解决这个问题。我有 2 张桌子
我想列出组织部门的用户 ID 计数。
你可以试试这个:
SELECT b.depname, count(a.id) FROM organization_dep_users a INNER JOIN Organization_dep b ON a.depid = b.id GROUP BY b.depname;
感谢 Barmar 提供更多详细信息。