Comparison and Set Operators

Comparison operators are applied to a single attribute. The following table shows all Amazon SimpleDB comparison operators.

Comparison OperatorDescriptionExample
=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-withAttribute 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 OperatorDescriptionExample
intersectionDetermine the intersection of ItemName sets['first name' = 'John'] intersection ['last name' = 'Smith']
unionDetermine the union of ItemName sets['tag' starts-with 'Amazon'] union ['description' = 'SimpleDB']
notDetermine the complement of ItemName set and all the items in the domainnot ['country' = 'USA' or 'country' = 'UK']