重复DB值 [英] Repetitve DB value

查看:97
本文介绍了重复DB值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在表格的一行中找到所有重复的值,例如123text123text(重复的子字符串之间可能会有换行符.

I need to find in a row of my table all the values that are repetitive, e.g. 123text123text (there might be a line break between the repetitive sub-strings.

所以我需要一个SQL查询,告诉PhpMyAdmin返回所有实例是值的子字符串的上半部分==子字符串的值的下半部分.

So I need an SQL query that tells PhpMyAdmin to return all instances were sub-string first half of value == sub-string second half of value.

-UPDATE 我认为查询不需要正则表达式,它只需要从行中选择值,即从一开始就是子字符串,直到字符串的一半等于一半的子字符串.直到结束 谢谢!

--UPDATE I don't think i need regex for my query it just needs to select values from the row were sub-string from begin until half of string equals sub-string from half of string until end Thanks!

推荐答案

好的,它就像

SELECT * FROM table_name WHERE substring(column, (length(column)/2)+1) like substring(column, 1, (length(column)/2)-1)

这篇关于重复DB值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆