0
我需要將此SELECT轉換爲ActiveRecord,但我沒有得到期望的結果。你可以幫我嗎?選擇是:將此SELECT轉換爲ActiveRecord
SELECT SUM(quantity) FROM (SELECT recipients.lang,COUNT(name) AS quantity FROM messages, recipients WHERE messages.lang=recipients.lang AND active=1 GROUP BY lang) AS temp;
非常感謝。
有時其良好的只是使用的find_by_sql。它更快。 – Shreyas 2010-11-12 09:19:30