I am tryin to compare last name between SRC and target table, names are same but they might have extra spaces or character, how do i ignore that? Is this the best way to do the comparison ltrim(rtrim(upper(substr(PERSON_LAST_NAME,1,3))))=ltrim(rtrim(upper(substr(CUST_LAST_NAME,1,3))))
Asked
Active
Viewed 80 times
0
-
Hey there...what is the reason for the (1,3) start and end points? – Victor Oct 02 '12 at 20:21
-
I am thinkin "trim()" and "like" might work. – paulsm4 Oct 02 '12 at 20:22
-
hey kaushik I want to compare upto 3 char only, so that there are more chances of matches – user803860 Oct 02 '12 at 20:33
1 Answers
0
You must before Trim and then substr string as follow
upper(substr(ltrim(rtrim(PERSON_LAST_NAME)),1,3))=upper(substr(ltrim(rtrim(CUST_LAST_NAME)),1,3))
hope this help

jackdev23
- 116
- 4