`$allConsultation = $this->getDoctrine()
->getRepository(Consultation::class);
$spConsultation = $allConsultation->createQueryBuilder('c')
->select('c')
->addselect('user')
->addselect('p')
->leftJoin('c.serviceProvider', 'user')
->leftJoin('c.pricingModel', 'p')
->select('MONTH(c.scheduleAt) AS m','(c.serviceProvider) AS sp')
->where('user.refer_token=:token')
->setParameter('token',$serviceProvider->getToken())
->andwhere('c.status= :s_id')
->setParameter('s_id', 'Finished')
->groupBy('sp')
->getQuery()
->getResult();`
SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #1
of SELECT list is not in GROUP BY clause and contains nonaggregated
column 'illicon.c0_.schedule_at' which is not functionally dependent
on columns in GROUP BY clause; this is incompatible with
sql_mode=only_full_group_by
question from:
https://stackoverflow.com/questions/65843331/i-have-a-syntax-error-in-my-query-builder 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…