Example of Mysql splitting into multiple rows or columns by a specific symbol

case when (length(path1) - length(replace (path1, "\\", ""))) / length("\\") +1 >=1 
then SUBSTRING_INDEX(SUBSTRING_INDEX(path1,'\\',1),'\\', -1 ) end as first_level_directory

insert image description here

Reference materials:
1. Example of Mysql splitting into multiple rows and columns according to a specific symbol
2. Mysql splitting a column into multiple records according to the delimiter Learning tutorial

Guess you like

Origin blog.csdn.net/shammy_feng/article/details/121267906