如何在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
答案 0 :(得分:1)
您可以执行以下操作:
$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");