mysql分组查询同组拼接合并

使用函数:GROUP_CONCAT( imei SEPARATOR ‘|’)

1
select car_id,GROUP_CONCAT( imei SEPARATOR '|') as all_imei from location_device where car_id is not NULL GROUP BY car_id