欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

MySQL 查询一串连续字符串

程序员文章站 2022-03-03 17:07:06
...

参考:https://blog.csdn.net/qiuli_liu/article/details/81707562

SELECT
	@xi := @xi + 1 AS xc 
FROM
	( SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4 UNION SELECT 5 ) xc1,
	( SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4 UNION SELECT 5 ) xc2,
	( SELECT @xi := 0 ) xc0