1500字范文,内容丰富有趣,写作好帮手!
1500字范文 > mysql字段分隔符拆分_MySQL——字符串拆分(含分隔符的字符串截取)

mysql字段分隔符拆分_MySQL——字符串拆分(含分隔符的字符串截取)

时间:2020-12-14 13:14:04

相关推荐

mysql字段分隔符拆分_MySQL——字符串拆分(含分隔符的字符串截取)

例子:

实际使用SQL语句:

SELECT

`a`.`user_name` AS `user_name`,

`a`.`user_id` AS `user_id`,

`a`.`unit` AS `unit`,

`a`.`topic_id` AS `topic_id`,

`a`.`topic_name` AS `topic_name`,

substring_index( substring_index( `a`.`field4`, '^', ( `b`.`id` + 1 ) ), '^',- ( 1 ) ) AS `field4`

FROM

(

`field4_view` `a`

JOIN `for_test` `b` ON (

(

`b`.`id` < ( ( length( `a`.`field4` ) - length( REPLACE ( `a`.`field4`, '^', '' ) ) ) + 1 )

)

)

)

WHERE

(

substring_index( substring_index( `a`.`field4`, '^', ( `b`.`id` + 1 ) ), '^',- ( 1 ) ) <> ''

)

来源:/brianlai/p/13350584.html

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。