mysql achieve String split (Split) Function

 

Database table bim_section_management the path is stored  abcd  string to . Segmentation, to achieve specific sql query as follows:

select
DISTINCT substring_index( substring_index(t1.path,'.',t2.help_topic_id + 1), '.' ,-1 )
from bim_section_management t1 join mysql.help_topic t2 on t2.help_topic_id < (length(t1.path) - length(REPLACE(t1.path,'.','')) + 1 )

If you multiplexing only need to replace the thickened portion of the code.

Guess you like

Origin www.cnblogs.com/id-tangrenhui/p/11928357.html