SOQL での複数選択リストのクエリ
SOQL クエリで複数選択リスト値を検索条件に指定する方法を紹介します。
選択リスト値は、AND/OR ロジックを使用して指定できます。
複数選択リスト項目に検索条件値を追加するには、セミコロンとカンマの文字を使用します。
セミコロンは、AND を指定するための特殊文字として使用されます。たとえば、表記 'AAA;BBB' は 'AAA' と 'BBB' を示します。
カンマは、OR を指定するための特殊文字として使用されます。たとえば、表記 'AAA','BBB' は 'AAA' または 'BBB' を示します。
例:
1.
Select id, name from Account where MSP1__c includes ('AAA;BBB')
次の値のいずれかが含まれている MSP1__c 項目内の値に対するクエリ検索条件。
AAA と BBB が選択されている。
2.
Select id, name from Account where MSP1__c includes('AAA;BBB','CCC')
次の値のいずれかが含まれている MSP1__c 項目内の値に対するクエリ検索条件。
AAA と BBB が選択されている。
CCC が選択されている。
3.
Select id, name from Account where MSP1__c includes('AAA', 'BBB','CCC')
次の値のいずれかが含まれている MSP1__c 項目内の値に対するクエリ検索条件。
AAA が選択されている。
BBB が選択されている。
CCC が選択されている。
詳細は、複数選択リストをクエリする方法を参照してください。
000386734

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.