--Finds any values that start with "a" and are at least 3 characters in length
WHERE CustomerName LIKE 'a_%_%'
WHERE CustomerName LIKE 'a__%'
Both start with
A, and end with
%. In the middle part, the first says "one char, then between zero and many chars, then one char", while the second one says "one char, then one char".
Considering that the part that comes after them (the final part) is
%, which means "between zero and many chars", I can only see both clauses as identical, as they both essentially just want a string starting with
A then at least two following characters. Perhaps if there were at least some limitations on what characters were allowed by the
_, then maybe they could have been different.
If I had to choose, I'd go with the second one for being more intuitive. After all, many other masks (e.g.
a%%%%%%_%%_%%%%%) will yield the same effect, but why the weird complexity?