Not Like Operator in SOQL

Sometimes we need “NOT LIKE” operator in SOQL.
But SOQL will not allow someone to write simple query using “Not Like” operator such as:

SELECT Name From Account Where Name Not Like '%Test%';

So, here is the solution:

SELECT Name From Account Where Not Name Like '%Test%';

If you are using “GROUP By” clause with “Not Like” operator, here is an example:

SELECT Name From Account Where Not Name Like '%Test%' Group By Name;

  • Transform Your Business Operations with Cloudy Coders – Leading Salesforce Implementation Partner.
    Experience a revolution in your business operations with Cloudy Coders, the Best Salesforce Implementation Partner in the USA. Our seasoned professionals ensure a smooth transition to Salesforce, offering tailored solutions for your unique needs. Elevate your efficiency today!