SELECT FROM SELECT aidbid AS seaservice_idacreate_timebtalent_user_idbcompany_idbtitlebpay_amountbpayment_waybcurrency bcompletion_timebsea_service_statusbservice_address COALES
这个错误是因为在使用GROUP BY语句时,SELECT语句中的某些列没有被包含在GROUP BY语句中,并且它们不属于聚合函数。这是MySQL的一个严格模式(sql_mode=only_full_group_by)下的限制。
解决方法是将所有SELECT语句中的列都包含在GROUP BY语句中,或者将它们都用聚合函数进行处理。在这个特定的查询中,可以将T.id列移除,或者将它用聚合函数进行处理,例如使用MAX或MIN函数:
SELECT MAX(T.id),b.id AS seaservice_id,a.create_time,b.talent_user_id,b.company_id,b.title,b.pay_amount,b.payment_way,b.currency,
b.completion_time,b.sea_service_status,b.service_address,
COALESCE(c.short_name_cn,e.realname, e.nickname, e.username) AS talentName,a.status AS applyStatus,IFNULL(d.has_withdraw,0) as hasWithdraw
FROM iw_seaservice_apply a
LEFT JOIN iw_seaservice b ON a.seaservice_id = b.id
LEFT JOIN iw_company c ON b.company_id = c.id
LEFT JOIN iw_seaservice_completion_apply d ON a.id = d.seaservice_apply_id
LEFT JOIN iw_talent_user e ON b.talent_user_id = e.id
${ew.customSqlSegment}
原文地址: https://www.cveoy.top/t/topic/fEBN 著作权归作者所有。请勿转载和采集!