GROUP_CONCAT合并列以及distinct是用

使用GROUP_CONCAT合并列,使用distinct会去掉列里面重复的数据

SELECT GROUP_CONCAT(distinct main.relator_name SEPARATOR ';') AS relator_name,
GROUP_CONCAT(distinct main.law_investigation_situ SEPARATOR ';') AS law_investigation_situ,main.relator_type,
main.asset_id
from amc.

未使用distinct效果图

使用后distinct效果图


猜你喜欢

转载自blog.csdn.net/weixin_42345739/article/details/80565476