我很难弄清楚从哪里开始将这个查询放入Zend_Db_Select。我从未在Zend中处理过变量赋值和子查询:
SELECT
@current_continent := stats_geo_continent.id AS `continent_id`,
(SELECT GROUP_CONCAT(code) from stats_geo_country WHERE stats_geo_country.continent = @current_continent) AS `group`,
stats_geo_country.code
FROM
stats_geo_continent
INNER JOIN
stats_geo_country ON stats_geo_country.continent = stats_geo_continent.id;