Pleace help(建議)。mysql(新手) - 加入
冷杉查詢返回正確的結果。
SELECT zbotr.kultura,SUM(zbotr.ukupno), SUM(gnojidba.ukupkn_gn) FROM zbotr
LEFT JOIN gnojidba ON zbotr.parent_id=gnojidba.parent_id
WHERE zbotr.user_id=54 AND (zbotr.pend between '2012-01-01' AND '2012-12-31')
GROUP BY zbotr.kultura;
當添加另一個表到查詢結果是:
SELECT zbotr.kultura,SUM(zbotr.ukupno), SUM(gnojidba.ukupkn_gn), SUM(operacije.uktros_ob) FROM zbotr
LEFT JOIN gnojidba ON zbotr.parent_id=gnojidba.parent_id
LEFT JOIN operacije ON zbotr.parent_id=operacije.parent_id
WHERE zbotr.user_id=54 AND (zbotr.pend between '2012-01-01' AND '2012-12-31')
GROUP BY zbotr.kultura;
什麼是你的問題/問題? – 2013-03-04 08:42:47