Hai spandy, Example For multiselect picklist value : proof is pancard or Aadharcard: Select name,customer__name,balance__c from customer__c where proof__c INCLUDES('pancard','Aadharcard')); (Or condition) Proof is pancard or Aadharcard and voterid: Select name,customer__name,balance__c from customer__c where proof__c INCLUDES('pancard','Aadharcard;voterid' )); (AND condition use;)
If you are tryng to retrieve Picklist Values and then use them into SOQL, it is possible. You need to first retrieve the picklist values using Dynamic Apex, store them into List an dthen use them into SOQL where statement. Please go through the below link to understand how to retrieve picklist values using Dynamic Apex -
https://developer.salesforce.com/blogs/developer-relations/2008/12/using-the-metadata-api-to-retrieve-picklist-values.html
To fetch picklist value for a particlay record you can use below SOQL statement - You can use picklist values in where clause of SOQL also like - Please accept my solution as Best Answer if my reply is helpful.
Example For multiselect picklist value :
proof is pancard or Aadharcard:
Select name,customer__name,balance__c from customer__c where proof__c INCLUDES('pancard','Aadharcard')); (Or condition)
Proof is pancard or Aadharcard and voterid:
Select name,customer__name,balance__c from customer__c where proof__c INCLUDES('pancard','Aadharcard;voterid' ));
(AND condition use ;)