In SQL I may write query with logical (true and true) or (true and true), i.e:
select * from t1 inner join t2 on ... where (t1.a != t2.a and t1.b != t2.b) or (t1. != t2.a and t1.b != t2.b)
when I try to do it in Q like this
select from ej[....] where (t1.a != t2.a and t1.b != t2.b) or (t1. != t2.a and t1.b != t2.b)
it fails to compile.
I have also tried this
(t1.a != t2.a and t1.b != t2.b) or (t1. != t2.a and t1.b != t2.b)
but it doesn't return the correct result either
How to query it in KDB?
Try this (in pseudo-code):
Kdb/Q reads left-of-right so it treats
as
rather than
unless you explicity use brackets