문제

I have simple table like this:

id (AUTO_INC)   |   text (VARCHAR 255)
 1                  hey!

is it possible to trim all the text values to remove all empty or hidden spaces in the field?

Cause if you can see this image you see the "word" field has strange hidden space char inside:

enter image description here thank you!

도움이 되었습니까?

해결책

To remove \t, \n and space you can do

update your_table
set `text` =  trim(replace(replace(`text`, '\n', ''), '\t',''))
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top