Reputation: 671
Take a look : FIDDLE
select IF((TRIM(replace(' IKECHUKWU OSUJI',' ',''))=TRIM(replace('IKECHUKWU OSUJI','
',''))),"same","diff");
select IF((TRIM(replace(' Aman Minhas ',' ',''))=TRIM(replace(' Aman Min has','
',''))),"same","diff");
The first query returns diff. The second returns same. Its some weird spacing issue, cant seem to understand why this behaviour.
Upvotes: 1
Views: 7305
Reputation: 26353
Your first string has a tab in it:
select IF((TRIM(replace(' IKECHUKWU OSUJI',' ',''))
^ this is actually a tab in the Fiddle
You can get rid of it with an additional REPLACE
:
REPLACE(REPLACE(myString, ' ', ''), '\t', '')
The \t
is a special literal. Other special literals such as newline or ASCII NUL may impact you as well. Literals are listed here.
Upvotes: 5