• 首页 首页 icon
  • 工具库 工具库 icon
    • IP查询 IP查询 icon
  • 内容库 内容库 icon
    • 快讯库 快讯库 icon
    • 精品库 精品库 icon
    • 知识库 知识库 icon
  • 更多 更多 icon
    • 服务条款 服务条款 icon

2022年01月20日发布mysql一行变成多行

武飞扬头像
xhjyxxw
帮助1

知行礼动

大家好,今日小科来聊聊一篇关于2022年01月20日整理发布:mysql如何将一行变成多行的文章,现在让我们往下看看吧!

mysql把一行变成多行的方法:1。将一行变成多行的代码是[substring _ index (a.rn,',',b.help _ topic _ ID 1),',',-1)];2.将多列变成多行。

Mysql将一行变成多行的方法:

保持

变成

挑选

substring _ index(substring _ index(a . rn,',',b.help_topic_id 1),',',- 1) AS rn

(选择“1,2,3,4”作为rn) a

JOIN MySQL . help _ topic b ON b . help _ topic _ id

(长度(a. rn)-长度(替换(A . rn,',',' '))1)将图A变成图b

图a

图二

挑选

substring _ index(substring _ index(a . rn,',',b.help_topic_id 1),',',- 1 ) AS rn

(从数字a中选择SUBSTR(GROUP _ CONCAT(REPEAT(CONCAT(number,',fre) SEPARATOR ' '))、1、LENGTH(GROUP _ CONCAT(REPEAT(CONCAT(number,',fre)SEPARATOR ' ')))-1)作为rn)

JOIN MySQL . help _ topic b ON b . help _ topic _ id

这就是mysql如何把一行变成多行的细节!

这篇好文章是转载于:知行礼动

  • 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
  • 本站站名: 知行礼动
  • 本文地址: /news/detail/tanhbggcji