开发者

How can I search for rows that contain a non-alphanumeric or space character?

开发者 https://www.devze.com 2023-03-22 18:12 出处:网络
I want to search a table for all ro开发者_Go百科ws that contain a non-alphanumeric and non-space character in a specific field. What I have so far:

I want to search a table for all ro开发者_Go百科ws that contain a non-alphanumeric and non-space character in a specific field. What I have so far:

SELECT *
FROM myTable
WHERE myField LIKE '%[^a-zA-Z0-9]%'

As far as I can tell, this returns all non-alphanumeric fields. However, spaces are fine, so I don't want to return rows where the only non-alphanumeric character is a space. How can I adjust this query?


How about you add the space:

SELECT *
FROM myTable
WHERE myField LIKE '%[^a-zA-Z0-9 ]%'
0

精彩评论

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