Take the 2-minute tour ×

I'm having a rough time figuring out where to start with getting this query into a Zend_Db_Select. I have never worked with variables assignment and subqueryies in Zend:

@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`,
Inner Join stats_geo_country ON stats_geo_country.continent = stats_geo_continent.id;
share|improve this question
If it is not needed, maybe use a $db->query(). You could also create a view in your database and make a model for it. I think it would be faster and more efficient than using Db_select. –  Marcin Feb 16 '11 at 11:35
add comment

1 Answer

I think it will be possible when you use Zend_Db_Expr for your variable assignments. For subgqueries you can use second Zend_Db_Select object as a part of main object - maybe that link will help you.

share|improve this answer
add comment

Your Answer


