UPDATE sys_area_copy1 aa
LEFT JOIN (
SELECT
area.area_id,
(
SELECT
GROUP_CONCAT( spliceArea.area_name ORDER BY spliceArea.LEVEL SEPARATOR '-' ) AS areaPathName
FROM
sys_area spliceArea
WHERE
spliceArea.area_id IN (
SELECT DISTINCT
SUBSTRING_INDEX( SUBSTRING_INDEX( excisionArea.area_path, '/', ht.help_topic_id + 1 ), '/',- 1 )
FROM
sys_area_copy1 excisionArea
JOIN mysql.help_topic ht ON ht.help_topic_id < ( length( excisionArea.area_path ) - length( REPLACE ( excisionArea.area_path, '/', '' ) ) + 1 )
WHERE
excisionArea.area_id = area.area_id
)
) AS areaPathName
FROM
sys_area_copy1 area
) bb ON aa.area_id = bb.area_id
SET area_path_name = bb.areaPathName
区域表根据区域id_path 新增一列 name_path
最新推荐文章于 2023-11-07 16:59:02 发布