---
title: ":: (colon colon sign) operator"
description: "Learn the syntax of the :: (colon colon sign) operator of the SQL language in Databricks SQL."
canonical_url: https://docs.databricks.com/aws/en/sql/language-manual/functions/coloncolonsign
---

# `::` (colon colon sign) operator

**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 the value `expr` to the target data type `type`. This operator is a synonym for [`cast` function](https://docs.databricks.com/aws/en/sql/language-manual/functions/cast.md).

## Syntax

```
expr :: type
```

## Arguments

* `expr`: Any castable expression.

## Returns

The result is type `type`.

This operator raises the same errors as [`cast` function](https://docs.databricks.com/aws/en/sql/language-manual/functions/cast.md). Use [`?::` (question double colon sign) operator](https://docs.databricks.com/aws/en/sql/language-manual/functions/questiondoublecolonsign.md) to return `NULL` on error instead.

## Common error conditions

* [CAST\_INVALID\_INPUT](https://docs.databricks.com/aws/en/error-messages/cast-invalid-input-error-class.md)
* [CAST\_OVERFLOW](https://docs.databricks.com/aws/en/error-messages/error-classes.md#cast_overflow)
* [DATATYPE\_MISMATCH](https://docs.databricks.com/aws/en/error-messages/datatype-mismatch-error-class.md)
* [NUMERIC\_VALUE\_OUT\_OF\_RANGE](https://docs.databricks.com/aws/en/error-messages/numeric-value-out-of-range-error-class.md)
* [UNSUPPORTED\_DATATYPE](https://docs.databricks.com/aws/en/error-messages/error-classes.md#unsupported_datatype)

## Examples

```sql
> SELECT '20'::INTEGER;
 20

> SELECT typeof(NULL::STRING);
 string

> SELECT 'abc'::INT;
  Error: CAST_INVALID_INPUT
```

## Related functions

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