Comparison operators are applied to a single attribute. The following table shows all Amazon SimpleDB comparison operators.
| Comparison Operator | Description | Example |
|---|---|---|
| = | Attribute value equals to the specified constant | ['city' = 'Seattle'] ['city' = 'Seattle' or 'city' = 'Portland] |
| != | Attribute value does not equal to the specified constant | ['name' != 'John'] ['name' != 'John' and 'name' != 'Humberto'] |
| > | Attribute value is greater than the specified constant | ['weight' > '0034'] |
| >= | Attribute value is greater than or equal to the specified constant | ['weight' >= '065'] |
| < | Attribute value is less than the specified constant | ['weight' < '0034'] |
| <= | Attribute value is less than or equal to the specified constant | ['year' <= '2000'] |
| starts-with | Attribute value starts with the specified constant | ['author' starts-with 'Robert'] |
does-not- start-with | Attribute value does not start with the specified constant | ['author' does-not-start-with 'Henry'] |
Set operators execute against sets of ItemName predicate results and do not consider attribute values. The following table shows all Amazon SimpleDB set operators
| Set Operator | Description | Example |
|---|---|---|
| intersection | Determine the intersection of ItemName sets | ['first name' = 'John'] intersection ['last name' = 'Smith'] |
| union | Determine the union of ItemName sets | ['tag' starts-with 'Amazon'] union ['description' = 'SimpleDB'] |
| not | Determine the complement of ItemName set and all the items in the domain | not ['country' = 'USA' or 'country' = 'UK'] |