您好,有一个查询会产生以下结果吗?
name count
19 - Evening ACL 1130
21 - 14 - 16 Provision 585
81 - HE FT 458
85 - HE PT 233
我怎样才能让查询加入包含'HE'的两行。我追求的结果是:
name count
19 - Evening ACL 1130
21 - 14 - 16 Provision 585
HE 691
这是我正在使用的查询
SELECT
vc.vc_name,
COUNT(DISTINCT s.s_studentreference) AS 'Count'
FROM
student s
INNER JOIN person p ON p.p_id = s.s_id
INNER JOIN moduleenrolment e ON e.e_student = p.p_id
INNER JOIN module m ON m.m_id = e.e_module
LEFT JOIN valid_codes vc ON vc.vc_code = m.m_mode AND vc.vc_domain = 'moa'
WHERE
LEFT(m.m_reference, 2) IN ('12')
GROUP BY
m.m_mode,
vc.vc_name
ORDER BY
m.m_mode,
vc.vc_name
谢谢