1
我有以下SQL SELECT:合併Zend框架2
SELECT c.id, c.code, c.closed, COALESCE(c2.name, c.name) AS name
FROM `centers` c
LEFT JOIN `centers_i18n` c2 ON c2.center_id = c.id
AND c2.lang = 'ES'
在我的Zend應用Y具有以下選擇:
$select = $sql->select();
$select->from($this->table);
$select->join($this->multiLangTable, $this->table . '.id=' .$this->multiLangTable . '.' . $this->foreignKey, $mapping);
$select->where($conditions);
這是一樣的,但我不知道該怎麼從列名稱合併。