MySQL select fields containing leading or trailing whitespace

后端 未结 4 786
轻奢々
轻奢々 2021-01-03 18:42

I can use the MySQL TRIM() method to cleanup fields containing leading or trailing whitespace with an UPDATE like so:

UPDATE Foo SE         


        
4条回答
  •  礼貌的吻别
    2021-01-03 19:06

    Here is an example with RegEx

    SELECT *
    FROM 
        `foo`
    WHERE 
       (name REGEXP '(^[[:space:]]|[[:space:]]$)')
    

提交回复
热议问题