- 有一张表
- 请按照一下格式查找
- 代码
SELECT man.dept, man.manG AS 男, womenG AS 女 FROM exercise LEFT JOIN( SELECT dept,COUNT( gender ) AS manG FROM exercise WHERE gender LIKE '男' GROUP BY dept ) AS man LEFT JOIN ( SELECT dept, COUNT( gender ) AS womenG FROM exercise WHERE gender LIKE '女' GROUP BY dept )AS woman ON man.dept = woman.dept ON exercise.dept = man.dept GROUP BY dept
9_23 数据库操作题
最新推荐文章于 2022-07-25 20:25:56 发布