Subject Re: [firebird-support] Firebird 3.0 : Reordering Fields in WHERE Search Condition of Query Returns Different Recordsets
Author Ivan Přenosil
> 1. On reordering the fields in WHERE search condition of a query, different sets of records are returned. Relevant details listed
> in subsequent Paras.
...
> SELECT a.USERNAME, a.USERPSWD FROM MYUSERS a where upper('%' || a.USERNAME || '%') like upper('%' || a.USERPSWD || '%')
...
> SELECT a.USERNAME, a.USERPSWD FROM MYUSERS a where upper('%' || a.USERPSWD || '%') like upper('%' || a.USERNAME || '%')
> xyz xyz
> abc abc
> pqr pqr123
> user user123

Works as expected.

LIKE is not symmetric operator - on the left there is *value*, on the right is *pattern*.
Pattern can contain wildcards, which are different from what you may be used to -
"_" means single character
"%" means zero or more characters !!!

Ivan