Guide To Writing Queries
And, Or, Not
8 min
a query consists of one or multiple query terms , which are connected using the logical operators and and or or or query terms are grouped together in a right associative manner what that beauty of a sentence means is that if you write this it will be interpreted like this this will match accounts satisfying either of the following conditions name name contains "inc" "inc" name name contains "ltd" "ltd" and and industry industry is "banking" "banking" in general, if you have something like this it will be interpreted like this it doesn't matter if you use and and or or or explicit parenthesis ( ) can be used to change this however you wish this will match accounts satisfying both of the following conditions name name contains "inc" "inc" or or "ltd" "ltd" industry industry is "banking" "banking" you can also wrap one or more query terms in not ( ) not ( ) , which negates the terms this will match accounts satisfying both of the following conditions name name contains neither "inc" "inc" nor "ltd" "ltd" industry industry is "banking" "banking" this will match accounts satisfying either of the following conditions name name contains "inc" "inc" either name name doesn't contain "ltd" "ltd" or industry industry isn't "banking" "banking" , or both there are some nuances about how negations and searching fields on linked records interact with each other, which might not be immediately apparent check out the section on fields & links docid\ kzbtllyb4xfj8df290vxi