gpt4 book ai didi

mysql - 按行计数的计数

转载 作者:行者123 更新时间:2023-11-29 22:06:46 25 4
gpt4 key购买 nike

这里我得到了三行计数的值,但我需要该行计数...

但无法编写查询...请帮助我...

SELECT COUNT(*) 
FROM sg_examinations e
JOIN sg_exam_types t
ON t.id = e.exam_name
LEFT
JOIN sg_courses c
ON c.id = e.course_id
WHERE e.branch_id = 1
AND e.academic_year = 2
GROUP
BY e.exam_name
, e.course_id

最佳答案

你的意思是:

SELECT e.exam_name, e.course_id, COUNT(*) 
FROM sg_examinations e
JOIN sg_exam_types t
ON t.id = e.exam_name
LEFT
JOIN sg_courses c
ON c.id = e.course_id
WHERE e.branch_id = 1
AND e.academic_year = 2
GROUP
BY e.exam_name, e.course_id

关于mysql - 按行计数的计数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32091320/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com