MYSQL关联表统计请教
时间:2021-07-01 10:21:17
帮助过:27人阅读
有2个表A,B
表A
uid gender (1男,2女)
1 1
2 2
3 1
4 2
5 1
表B
uid department (1客服部,2运营部)
1 1
2 1
3 2
4 2
5 1
怎么样写 SELECT COUNT(*),可以
统计 客服部,男性的 数量
谢谢
回复讨论(解决方案)
SELECT COUNT(*) from A, B where A.uid=B.uid and A.gender =1 and B.department=1
谢谢版主