The field expression syntax of the WHERE clause in a SOQL query consists of a field
name, a comparison operator, and a value. The query uses these components to compare the field
name value to records being searched.
fieldExpression uses the following syntax:
1fieldName comparisonOperator value
| fieldName |
The name of a field for the specified object. Use of
single or double quotes around the name result in an error. You must have at least
read-level permissions to the field. It can be any field except a long text area field,
encrypted data field, or base64-encoded field. The name doesn’t need to be a field in the
fieldList. |
| comparisonOperator |
Operators that compare values, such as =,<=, IN, and LIKE. Operators are
case insensitive for most fields, but case sensitive for case-sensitive fields. |
| value |
A value used to compare with the value in the
fieldName. Supply a value whose data type matches the field type of the
specified field. The value must be a valid value, not other field names or calculations. If
quotes are required, use single quotes. Double quotes result in an error. Quotes are
unnecessary for dates and numbers. |