Tag: group concat

如何在Rails中使用GROUP_CONCAT?

我有以下查询,我想与ActiveRecord一起使用,以便它可以在生产服务器上的基于ORACLE的本机查询中进行翻译。 现在我正在使用SQLITe。 select c.name,co.code,GROUP_CONCAT(c.name) AS GroupedName from countries c INNER JOIN continents co on c.continent_code = co.code INNER JOIN event_locations el on el.location_id = c.id group by co.code