July 2010
Intermediate to advanced
840 pages
16h 33m
English
A very important point that is often missed is that two strings can be equal but not LIKE in SQL. The test of equality first pads the shorter of the two strings with rightmost blanks, then matches the characters in each, one for one. Thus ‘Smith’ and ‘Smith’ (with three trailing blanks) are equal. However, the LIKE predicate does no padding, so 'Smith' LIKE 'Smith ' tests FALSE because there is nothing to match to the blanks.
A good trick to get around these problems is to use the TRIM() function to remove unwanted blanks from the strings within either or both of the two arguments.
Read now
Unlock full access