开发者

How to get all rows that contain characters others than [a-zA-Z] in MySQL

I would like to ask if there is a possible way to select all rows from a table where the content of a column (varchar(255)) may contain characters others than standard english (a-zA-Z) or characters from different languages like Gr开发者_高级运维eek, French.

For example if the table contains the following data:

-- ID, Address --
|  1, "Test1"   | 
|  2, "Tåst2"   |
|  3, "Test1"   |

I would like to get only the 2nd row (2, "Tåst2")

I tried to use regular expression doing the following:

SELECT * FROM contact_info WHERE address NOT REGEXP '[a-zA-Z]';

But no luck!

Any help would be appreciated!


Match the whole text

SELECT * 
FROM contact_info 
WHERE address NOT REGEXP '^[a-zA-Z0-9]*$';
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜