这部分主要为拆分字段使用、
将表内 CLOSING_CASE 中的多个字段拆分出来拆分成多行,然后在进行分组统计数据
SELECT
ROAD_PRODUCT_CASE_ID,
REGEXP_SUBSTR (CLOSING_CASE, '[^、]+', 1, LEVEL) CLOSING_CASE
FROM
VIEW_ROAD_CASE
CONNECT BY LEVEL <= REGEXP_COUNT (CLOSING_CASE, '、') + 1
AND ROAD_PRODUCT_CASE_ID = PRIOR ROAD_PRODUCT_CASE_ID
AND PRIOR dbms_random.VALUE
IS NOT NULL
SELECT a.RowGuid,substring_index(substring_index(a.anquanyuanname,',',b.help_topic_id + 1),',',-1)
FROM
smz_projectbuilderlicense a
JOIN
mysql.help_topic b
ON b.help_topic_id < (LENGTH(a.anquanyuanname) - LENGTH(REPLACE(a.anquanyuanname,',',''))+1)
ORDER BY a.RowGuid;
mysql
SELECT
tp.id,
tp.label_name,
tp.view_count,
substring_index(substring_index(tp.label_name,’,’,b.help_topic_id + 1),’,’,- 1) as label_id
FROM
temp as tp
JOIN mysql.help_topic b ON b.help_topic_id < (length(tp .label_name) - length(REPLACE(tp.label_name, ‘,’, ‘’)) + 1) ORDER BY tp.view_count DESC;