function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Kamal BollineniKamal Bollineni 

SOQL Query excluding

If I want exclude records starting with '__%' on an Account object how can we write a SOQL query  
Eg: SELECT Id, Name, Status from Account where Name Like 'HA%' - this query will fetch all the receords starting with HA.  But Here I want all the records by 
Best Answer chosen by Kamal Bollineni
CharuDuttCharuDutt
Hii Kamal Try Below Example
SELECT Id, Name from Account where NOT Name Like 'HA%'

Please Mark It As Best Asnwer If It Helps
Thank You!

All Answers

CharuDuttCharuDutt
Hii Kamal Try Below Example
SELECT Id, Name from Account where NOT Name Like 'HA%'

Please Mark It As Best Asnwer If It Helps
Thank You!
This was selected as the best answer
Kamal BollineniKamal Bollineni
Hello Mr. Dutt, I have tried this query, unfortunately displaying all the records in the object including records starts with the stirng given above
Kamal BollineniKamal Bollineni
Hello Mr. Dutt - The above query was working fine for me thanks and sorry for the last post
Now I can fetch the records other than "HA%'