I have solved this issue by using Zend\Db\Sql\Expression
in the ON
clause of join()
.
$select->columns(array('match_code'))
->join('countries',new \Zend\Db\Sql\Predicate\Expression('countries.cid = SUBSTR(matches.teams,1,3)'), 'name')
->where(array('round'=>1));
Thanks to @Crisp for the suggestion.