you can just compare substrings!
substr(mn1.onmfirst, 1,3) <> substr(mn2.onmfirst, 1,3)
سؤال
I have two tables with the same structure that I am comparing, MN1 and MN2. Both tables contain a column called onmfirst which contains a name. I am trying to write a query that will compare the first names and only select records that are different, specifically only return names that don't match and are off by at least the first 3 characters.
The query is current running a simple "mn1.onmfirst <> mn2.onmfirst". This of course will display records that don't match and doesn't take into consideration the name may be the same and just shortened.
For example:
RETURNED/EXPECTED RESULTS
NOT RETURNED/OMITTED
Appreciate it!
المحلول
you can just compare substrings!
substr(mn1.onmfirst, 1,3) <> substr(mn2.onmfirst, 1,3)