

# Boolean Functions
<a name="sql-reference-boolean-functions"></a>

The topics in this section describe the boolean functions for Amazon Kinesis Data Analytics streaming SQL.

**Topics**
+ [ANY](sql-reference-any.md)
+ [EVERY](sql-reference-every.md)

# ANY
<a name="sql-reference-any"></a>

```
ANY ( <boolean_expression> )
```



ANY returns true if the supplied boolean\$1expression is true in any of the selected rows. Returns false if the supplied boolean\$1expression is true in none of the selected rows.

**Example**  
The following SQL snippet returns 'true' if the price for any ticker in the stream of trades is below 1. Returns 'false' if every price in the stream is 1 or greater.

```
 SELECT STREAM ANY (price < 1) FROM trades
  GROUP BY (FLOOR trades.rowtime to hour)
```

# EVERY
<a name="sql-reference-every"></a>

```
EVERY ( <boolean_expression> )
```

EVERY returns true if the supplied boolean\$1expression is true in all of the selected rows. Returns false if the supplied boolean\$1expression is false in any of the selected rows.

**Example**  
The following SQL snippet returns 'true' if the price for every ticker in the stream of trades is below 1. Returns 'false' if any price is 1 or greater.

```
 SELECT STREAM EVERY (price < 1) FROM trades
  GROUP BY (FLOOR trades.rowtime to hour)
```