SELECT UT_10, LT_10, ACT_10, LT_10 - ACT_10, UT_10 - ACT_10
FROM distributor
WHERE (
LT_10 - ACT_10 <>1
OR LT_10 - ACT_10 <>2
)
AND ACT_10 <>10
AND
(
UT_10 - ACT_10 =1
OR UT_10 - ACT_10 =2
)
AND ACT_10 <>10
I wrote this query in mysql. I don’t want 1 or 2 result but 1 is display in result please help me.
or condition is not working with mysql query.
you can see here result: CLICK HERE FOR LARGE IMAGE

Replace
With
Results where
LT_10 - ACT_10equals1are returned by your original query because you usedOR, if you only wanted results where it is not equal to either you should have usedAND. This can be shortened usingNOT INas shown in my example above.Your original condition serves no purpose as
LT_10 - ACT_10can only take one value – it will never be equal to1and2(which is what would be needed for both parts of the originalORcondition to evaluate tofalse)