截取mysql查询结果字符串

我这个方法非常笨,但是有用,如果有好的方法可以留言哈:

SELECT
	create_date,
	trim(
		REPLACE (
			REPLACE (
				LEFT (
					substring_index(content, 'name=' ,- 1),
					5
				),
				'd',
				''
			),
			',',
			''
		)
	)
FROM
	t_log_item
WHERE
	log_type = 'userinfoCreate'
AND TO_DAYS(NOW()) - TO_DAYS(create_date) <= 2
AND content LIKE '[COMM_INFO]%name%';


猜你喜欢

转载自blog.csdn.net/sky_jiangcheng/article/details/78854983