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

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

java - Digest auth with Spring Security using javaconfig -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -