SELECT @Pn:=id id, @pathId:=(SELECT GROUP_CONCAT(SUBSTRING_INDEX( @Pn:=(SELECT CONCAT(parent_id,'|',name) FROM org WHERE id = SUBSTRING_INDEX(@Pn,'|',1)), '|',-1) ORDER BY id DESC SEPARATOR'-') FROM org WHERE @Pn IS NOT NULL ORDER BY id ASC)as name,create_time,parent_id,status,type,update_time,deleted FROM org WHERE id in (参数值)
标签:组织,WHERE,全量,Mysql,org,Pn,id,SELECT From: https://www.cnblogs.com/wj123bk/p/16779013.html