Use disjunctions in complex queries

ServiceNow performs conjunction statements before disjunction statements in a query.

When you create a complex query, you must use parenthesis around disjunctions where appropriate to ensure proper grouping of query elements. For example, you must use parenthesis in the query (md_table = 'incident' || md_table = 'task') && mi_definition = md_sys_id && mi_id = inc_sys_id. Removing the parenthesis from this query returns all records where the md_table value is incident.