开发者

Translate this SELECT to ActiveRecord

开发者 https://www.devze.com 2023-01-24 12:41 出处:网络
I need to translate this SELECT to ActiveRecord but I don开发者_JAVA百科\'t get the desire result. Can you help me? The SELECT is:

I need to translate this SELECT to ActiveRecord but I don开发者_JAVA百科't get the desire result. Can you help me? The SELECT is:

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;

Thank you very much.


I solved this question with ActiveRecord::Base.connection.execute

Thanks

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号