>>Some records from M where represented twice in the first result set because of INNER JOIN ?
>>What would be count for
>>
>>SELECT DISTINCT M2.AI
>> FROM M AS M2
>>...
>>
>
>You were right. Distinct does return 26401 records. I will have to add this clause in my main SQL to make sure to only get the primary keys as is.
>
>Thanks
Select your data as CTE (common table expression) and then update based on it - it would be easier to debug,
If it's not broken, fix it until it is.
My Blog