I am trying to build a query in Apex code to fetch all records where a multi select picklist has either of 2 values selected. When I build my query and string as option 1 it does not return back any data . However option 2 returns back corrent number of rows.
option1
string str = '\'Ann-OP\',\'Ann-RP\'';
List<Announcement__c> aL = [SELECT Id, Name FROM Announcement__c
WHERE Public_groups__c INCLUDES (:str) ];
option2
List<Announcement__c> aL = [SELECT Id, Name FROM Announcement__c
WHERE Public_groups__c INCLUDES('Ann-OP', 'Ann-RP') ];