performance - IS MySQL logical operator XOR equivalent OR with negation -
is there difference in results , performance between queries ?
select a.id table (c1 = 'value' xor c2 = 'value'); select a.id table (c1 != 'value' or c2 !='value');
xor
not equivalent or
negation. xor
equivalent following logic:
where ((c1 = 'value' , c2 = 'value') or (c1 <> 'value' , c2 <> 'value') )
interestingly, second expression same as:
where not (c1 = 'value' , c2 = 'value')
i think should review boolean logic , truth tables.
Comments
Post a Comment