選取您的 Cookie 偏好設定

我們使用提供自身網站和服務所需的基本 Cookie 和類似工具。我們使用效能 Cookie 收集匿名統計資料,以便了解客戶如何使用我們的網站並進行改進。基本 Cookie 無法停用,但可以按一下「自訂」或「拒絕」以拒絕效能 Cookie。

如果您同意,AWS 與經核准的第三方也會使用 Cookie 提供實用的網站功能、記住您的偏好設定,並顯示相關內容,包括相關廣告。若要接受或拒絕所有非必要 Cookie,請按一下「接受」或「拒絕」。若要進行更詳細的選擇,請按一下「自訂」。

Comparison Operators

焦點模式
Comparison Operators - Amazon SimpleDB
此頁面尚未翻譯為您的語言。 請求翻譯

Comparison operators are applied to a single attribute and are lexicographical in nature. When designing an application, you should carefully think through storing data in its appropriate string representation. For more information, see Working with Numerical Data.

The following table shows all Amazon SimpleDB comparison operators.

Comparison Operator Description Select Example
= Attribute value or itemName() equals the specified constant.

select * from mydomain where city = 'Seattle'

select * from mydomain where city = 'Seattle' or city = 'Portland'

!= Attribute value or itemName() does not equal to the specified constant.

select * from mydomain where name != 'John'

select * from mydomain where name != 'John' and name != 'Humberto'

> Attribute value or itemName() is greater than the specified constant. select * from mydomain where weight > '0034'
>= Attribute value or itemName() is greater than or equal to the specified constant. select * from mydomain where weight >= '065'
< Attribute value or itemName() is less than the specified constant. select * from mydomain where weight < '0034'
<= Attribute value or itemName() is less than or equal to the specified constant. select * from mydomain where year <= '2000'
like

Attribute value or itemName() contains the specified constant.

The like operator can be used to evaluate the start of a string ('string%'), the end of a string ('%string'), or any part of a string ('%string%').

Note

Using the like operator to evaluate the end of a string or any part of a string is an expensive operation. Make sure to combine it with other predicates to reduce number of items it has to evaluate.

To search for strings that contain the percent sign (%), you must escape it. For example, to search for a string that ends in '3%', you enter select * from mydomain where name like '%3\%'. To search for a string that begins with '3%', you enter select * from mydomain where name like '3\%%'. To search for a string that contains '3%', you enter select * from mydomain where name like '%3\%%'.

select * from mydomain where author like 'Henry%' select * from mydomain where keyword = 'Book' and author like '%Miller'

not like

Attribute value or itemName() does not contain the specified constant.

The not like operator can be used to evaluate the start of a string ('string%'), the end of a string ('%string'), or any part of a string ('%string%').

Note

Using the not like operator to evaluate the end of a string or any part of a string is an expensive operation. Make sure to combine it with other predicates to reduce number of items it has to evaluate.

select * from mydomain where author not like 'Henry%' select * from mydomain where keyword = 'Book' and author not like '%Miller'
between Attribute value or itemName() falls within a range, including the start and end value. select * from mydomain where year between '1998' and '2000'
in Attribute value or itemName() is equal to one of the specified constants. When used with items, in acts as a batch get. select * from mydomain where year in('1998','2000','2003') select * from mydomain where itemName() in('0385333498','0802131786','B000T9886K')
is null Attribute does not exist. If an item has the attribute with an empty string, it is not returned.
Note

Due to performance issues, this operator is not recommended when most items have the specified attribute.

select * from mydomain where year is null
is not null Attribute value or itemName() contains any value. select * from mydomain where year is not null
every() For multi-valued attributes, every attribute value must satisfy the constraint.
Note

Due to the cost of running more complex queries, this operator is only recommended for multi-valued attributes.

select * from mydomain where every(keyword) = 'Book'

select * from mydomain where every(keyword) like '***%'

隱私權網站條款Cookie 偏好設定
© 2025, Amazon Web Services, Inc.或其附屬公司。保留所有權利。