Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

Logical operators - Amazon Timestream

Logical operators

Timestream for LiveAnalytics supports the following logical operators.

Operator Description Example

AND

True if both values are true

a AND b

OR

True if either value is true

a OR b

NOT

True if the value is false

NOT a

  • The result of an AND comparison may be NULL if one or both sides of the expression are NULL.

  • If at least one side of an AND operator is FALSE the expression evaluates to FALSE.

  • The result of an OR comparison may be NULL if one or both sides of the expression are NULL.

  • If at least one side of an OR operator is TRUE the expression evaluates to TRUE.

  • The logical complement of NULL is NULL.

The following truth table demonstrates the handling of NULL in AND and OR:

A B A and b A or b

null

null

null

null

false

null

false

null

null

false

false

null

true

null

null

true

null

true

null

true

false

false

false

false

true

false

false

true

false

true

false

true

true

true

true

true

The following truth table demonstrates the handling of NULL in NOT:

A Not a

null

null

true

false

false

true

PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.