如何在magento 1.8.0.0中运行下面的mysql查询
select
m.*,
group_concat(c.store_id)
from
news m
join news_store c on find_in_set(c.news_id, m.news_id)
group by
m.news_id
最佳答案
您可以执行以下操作:
$read = Mage::getSingleton('core/resource')->getConnection('core_read');
// now $write is an instance of Zend_Db_Adapter_Abstract
$read ->query("select m.*,
group_concat(c.store_id)
from
news m
join news_store c on find_in_set(c.news_id, m.news_id)
group by
m.news_id");
关于mysql - 在magento 1.8.0.0版本中运行mysql复杂查询,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20467314/