id-tangrenhui

 

数据库表bim_section_managementpath中存储的值为 a.b.c.d 的字符串形式,以 . 分割,实现查询具体的sql如下:

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 )

如果复用只需要替换加粗部分代码即可。该方法需要明确a,b,c,d字符长度均相同一致才会分割生效,有一定局限性。

分类:

技术点:

相关文章:

  • 2021-09-27
  • 2021-11-22
  • 2021-11-13
  • 2021-11-05
  • 2021-12-23
  • 2021-12-18
  • 2021-09-27
  • 2021-12-12
猜你喜欢
  • 2021-12-23
  • 2021-11-04
  • 2021-11-13
  • 2021-07-15
  • 2021-12-18
  • 2021-09-27
相关资源
相似解决方案