Compare Values Between Fields in SOQL (Beta)

Perform arithmetic calculations directly in a SOQL WHERE clause with the FORMULA() function. Use this functionality to compare values between fields without adding a formula field or post-processing logic, and write more efficient and expressive queries.

Where: This change applies to Lightning Experience and Salesforce Classic in Group, Professional, Enterprise, Performance, Unlimited, Developer, and Database.com editions. The beta is available in sandbox, Developer Edition, and scratch orgs in API version 68.0 and later. It isn't available in production orgs.

Note
Note Arithmetic formulas in a SOQL WHERE clause is a beta service that is subject to the Beta Services Terms at Agreements - Salesforce.com or a written Unified Beta Agreement if executed by Customer, and applicable terms in the Product Terms Directory. Use of this beta service is at the Customer's sole discretion.