在 MySQL 中查找换行符和回车符 (\r\n)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10997159/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 13:47:07  来源:igfitidea点击:

Finding line break and carriage return (\r\n) in MySQL

mysqlregexselectcarriage-returnline-breaks

提问by Display name

I can't seem to find any info about this on the internet (or I'm just not looking in the right direction).

我似乎无法在互联网上找到任何关于此的信息(或者我只是没有朝着正确的方向寻找)。

I have a few fields in my MySQL database containing a carriage return and line break \r\n .

我的 MySQL 数据库中有几个字段包含回车符和换行符 \r\n 。

Is there somebody who can tell me how to find them by using a query??

有没有人可以告诉我如何使用查询找到它们?

回答by Tim Pietzcker

SELECT * FROM mytable WHERE mycolumn REGEXP "\r\n";

finds all records in mytablewhere mycolumncontains a \r\nsequence.

查找mytablewhere 中mycolumn包含\r\n序列的所有记录。