I have the following query builder:
$queryBuilder = $this
->createQueryBuilder('recipient')
->leftJoin('recipient.message', 'message')
->orderBy('message.dateSent', 'DESC');
This has been working fine :) - but since upgrading to Mysql 5.7 I have started getting this error everywhere:
SQLSTATE[HY000]:
General error: 3065
Expression #1 ofORDER BYclause is not inSELECTlist, references column'dctrn_result.date_sent_5'which is not inSELECTlist;
this is incompatible withDISTINCT
I have solved this in most places where I am using the DBAL layer by just add the item to the select list, but I can't figure out how to do that with this particular queryBuilder.