---
title: boolean function
description: Learn the syntax of the boolean function of the SQL language in Databricks SQL and Databricks Runtime.
canonical_url: https://docs.databricks.com/aws/en/sql/language-manual/functions/boolean
---

# `boolean` function

**Applies to:** ![check marked yes](https://docs.databricks.com/aws/en/images/icons/check.png) Databricks SQL ![check marked yes](https://docs.databricks.com/aws/en/images/icons/check.png) Databricks Runtime

Casts `expr` to boolean. This function is a synonym for `CAST(expr AS binary)`. See [`cast` function](https://docs.databricks.com/aws/en/sql/language-manual/functions/cast.md) for details.

## Syntax

```
boolean(expr)
```

## Arguments

* `expr`: Any expression that can be cast to BOOLEAN.

## Returns

A BOOLEAN.

## Examples

```sql
> SELECT boolean(1);
 true
> SELECT boolean(0);
 false

> SELECT boolean(2);
 true
```

## Related functions

* [`cast` function](https://docs.databricks.com/aws/en/sql/language-manual/functions/cast.md)
