MySQL CAST() Function
Definition and Usage
The CAST() function converts a value (of any type) into the specified datatype.
Tip: See also the CONVERT() function.
Syntax
CAST(value AS datatype)
Parameter Values
| Parameter | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| value | Required. The value to convert | ||||||||||||||||||||
| datatype | Required. The datatype to convert to. Can be one of the following:
|
Technical Details
| Works in: | From MySQL 4.0 |
|---|