Mysql字符串常量行转列

2023-02-16 14:49:34 浏览数 (3)

代码语言:sql复制
SELECT
	SUBSTRING_INDEX( SUBSTRING_INDEX( '7654,7698,7782,7788', ',', help_topic_id   1 ), ',',- 1 )
	 AS num 
FROM
	mysql.help_topic 
WHERE
	help_topic_id < LENGTH( '7654,7698,7782,7788' )- LENGTH(
	REPLACE ( '7654,7698,7782,7788', ',', '' ))  1

0 人点赞