有没有办法将这两个查询组合成一个查询,以便我可以检索两个数据“系列”以用于图表目的,同时仍保持单个日期的关系?
SELECT
COUNT(j.id) AS power_count, jd.ber_rcvd
FROM
jobs j
INNER JOIN job_dates jd
ON jd.job_id = j.id
WHERE j.tech = 7 AND jd.ber_rcvd != '0000-00-00' GROUP BY jd.ber_rcvd;
SELECT
COUNT(j.id) AS transport_count, jd.ber_rcvd
FROM
jobs j
INNER JOIN job_dates jd
ON jd.job_id = j.id
WHERE j.tech = 1 AND jd.ber_rcvd != '0000-00-00' GROUP BY jd.ber_rcvd;
我正在寻找的是这样的输出:
power_count | 运输计数 | ber_rcvd
11 | 3 | 2013-03-01
7 | 1 | 2013-03-02