Fixes sync sql command that uses left join instead of inner join, which adds unnecessary comparisons and might result in incorrect mapping between databases.