mysql笔记

168 阅读1分钟

怎样去重

select max(id), max(status), max(type), max(status), CustomerId from consultations where LawyerId = 6 group by(CustomerId) limit 1

13:35:07 select id,max(status), CustomerId from consultations group by(CustomerId) LIMIT 0, 1000 Error Code: 1055. Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'zherentech.consultations.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by 0.00021 sec