I just stumbled upon a soql query where somebody did the following
List<String> names = new List<String>{'John', 'Moe', 'Jeanette', 'Tony'};
List<Client__c> clients = [
SELECT Id
FROM Client__c
WHERE First_Name__c = :names
];
I am not familiar with the usage of the equal sign(=) to check against a list/set as opposed to WHERE First_Name__c IN :names
.
I am having a hard time finding the difference as it seems like using =
works similarly but does it work the same way? Are there any dangers to using it?
select name from lead where name = ('john doe','jane doe')
. This is one of the few magic behaviors of SOQL in Apex.