我需要将此SELECT转换为ActiveRecord,但我没有获得所需的结果。你能帮助我吗? SELECT是:
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;
非常感谢。
答案 0 :(得分:0)
我用ActiveRecord :: Base.connection.execute
解决了这个问题由于