# BINARY

Casts the input to a binary data type.

There is usually no visible effect on the printed value; what changes is the rules for comparison and sorting.

## Syntax

```sql
BINARY( input )

```

## Return Type

A binary object.

## Examples

```sql
SELECT 'ohai' = 'OHAI', BINARY('ohai') = 'OHAI';

```

```output

+-----------------+-------------------------+
| 'ohai' = 'OHAI' | BINARY('ohai') = 'OHAI' |
+-----------------+-------------------------+
|               1 |                       0 |
+-----------------+-------------------------+

```

***

Modified at: March 8, 2024

Source: [/db/v9.1/reference/sql-reference/string-functions/binary/](https://docs.singlestore.com/db/v9.1/reference/sql-reference/string-functions/binary/)

(An index of the documentation is available at /llms.txt)
