0
SELECT qurum_id, qurum, COUNT(qurum1) AS I FROM `qurum` AS qur
JOIN (SELECT id, qurum1,input_date FROM DATA) `aa` ON qur.qurum_id =
aa.qurum1
WHERE DATE_FORMAT(aa.input_date, '%Y') = $year AND DATE_FORMAT(aa.input_date, '%m') < 07
GROUP BY qurum_id
ORDER BY qurum_id
SELECT qurum_id, qurum, COUNT(qurum1) AS II FROM `qurum` AS qur2
JOIN (SELECT id, qurum1,input_date FROM DATA) `bb` ON qur2.qurum_id =
bb.qurum1
WHERE DATE_FORMAT(bb.input_date, '%Y') = $year AND DATE_FORMAT(bb.input_date, '%m') BETWEEN 06 AND 12
GROUP BY qurum_id
ORDER BY qurum_id
我如何加入這些查詢到1?我需要這樣的專欄 - qurum_id,Qurum,I,II。
你可以用'union' – Shadow
同時存儲腳本在兩個不同溫度的/ var表的輸出,然後用結合。 –
我知道,但是怎麼樣?你能寫嗎? –