SELECT only rows that contain only alphanumeric characters in MySQL

前端 未结 6 1187
天涯浪人
天涯浪人 2020-12-05 01:42

I\'m trying to select all rows that contain only alphanumeric characters in MySQL using:

SELECT * FROM table WHERE column REGEXP \'[A-Za-z0-9]\';
         


        
6条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-05 02:20

    Try this:

    REGEXP '^[a-z0-9]+$'
    

    As regexp is not case sensitive except for binary fields.

提交回复
热议问题