Description
Converts a value from one data type to another
Syntax
CAST(expression AS datatype(length))
Parameters
| Parameter | Description | Data Type | Required |
|---|---|---|---|
| expression | Column or expression to evaluate | Any | Yes |
| as_type | Target data type for the conversion | Type name | Yes |
Notes
- Requires CAST(x AS type). Two-arg CAST(x, 'type') is unsupported.
Example
SELECT
CAST(employee_number AS varchar)
FROM
rippling.employee.Employee
LIMIT
5;