with a as( select * from( select 1 userId , '天津' province union select 1 userId , '北京' union select 1 userId , '上海' union select 2 userId , '北京' union select 2 userId , '上海' ) model ) select distinct userId, stuff( (select ','+province from a where u…