Try using replace function
select replace(col1,' ','') as col1, length(col1) as withSpace,length(replace(col1,' ',''))as withoutspace from t
Check demo of answer here demo solution
You can see that column withSpace shows length of text without any replacement and column withoutspace shows length of text after replacement.
Brekhnaa posted this
Have an answer?