SOQL 기본문법(02)


Fri, May 24, 2019 written by Yong-Jin

복수 선택 Picklist 쿼리

Operator Description
= Equals the specified string.
!= Does not equal the specified string.
includes Includes (contains) the specified string.
excludes Excludes (does not contain) the specified string.
; Specifies AND for two or more strings.
SELECT Id, MSP1__c FROM CustObj__c WHERE MSP1__c = 'AAA;BBB'
SELECT Id, MSP1__c from CustObj__c WHERE MSP1__c includes ('AAA;BBB','CCC')
 

비교 연산자

Operator Name Description
= Equals
!= Not equals
< Less than
<= Less or equal
> Greater than
>= Greater or equal
LIKE Like SELECT AccountId, FirstName, lastname
FROM Contact
WHERE lastname LIKE ‘appl%’
IN IN SELECT Name FROM Account
WHERE BillingState IN (‘California’, ’New York’)
NOT IN NOT IN SELECT Name FROM Account
WHERE BillingState NOTIN (‘California’, ’New York’)
INCLUDES
EXCLUDES
Applies only to multi-select picklists.
 

논리 연산자

Operator Syntax Description
AND X AND Y true if both X and Y are true.
OR X OR Y true if either X or Y is true.
NOT NOT X true if X is false.