Precedence

DQL has a natural precedence (order of processing) where ANDed terms are processed before ORed terms.

In the following example, the order_origin and date_origin results are ANDed together and then that result is ORed with the partno results:
partno = 388388 or order_origin in (‘London’, ‘LA’, ‘Tokyo’) AND 
date_origin > @dt(‘20160511’)
To override natural precedence, use parentheses. In the following example, a parentheses surrounding the date_origin and partno terms means they are ORed and the result is ANDed with the results of order_origin:
order_origin in (‘London’, ‘LA’, ‘Tokyo’) AND 
(date_origin > @dt(‘20160511’) OR 
partno = 388388)