Answer the question
In order to leave comments, you need to log in
How to write correct join min value in zend?
Error Statement could not be executed (HY000 - 1111 - Invalid use of group function)
$select->join(
DbTables::TBL_APARTMENT_IMAGES,
new Expression(
DbTables::TBL_APARTMENT_IMAGES . '.apartment_id = ' . $this->getTable() . '.id AND MIN(' .
DbTables::TBL_APARTMENT_IMAGES . '.image_order)'
),
[
'image_path',
],
Select::JOIN_LEFT
);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question