CAST(eExpression AS cDataType [(nFieldWidth [, nPrecision])] [NULL | NOT NULL]) ParameterseExpression Specifies a data expression, usually in a SQL statement, that you want to convert to another data type. eExpression can be a field, calculated field, or other type of expression. cData...
data-type Specifies the data type of the result. If the data type is not qualified, the SQL path is used to find the appropriate data type. For more information, see Unqualified function, procedure, specific name, type, and variables. For a description of data-type, see CREATE TABLE. ...
CAST(eExpression AS cDataType [(nFieldWidth [, nPrecision])] [NULL | NOT NULL]) Parameters eExpression Specifies a data expression, usually in a SQL statement, that you want to convert to another data type. eExpression can be a field, calculated field, or other type of expression. ...
row-type-name Specifies the name of a user-defined row type. Therow-expressionmust be castable torow-type-name(SQLSTATE 42846). interval-cast-specification A cast specification where the input is a character string representation of an interval and the result is a decimal duration. The followin...
The function then converts the input value into the specified type as expressed in the following syntax: CAST(expression AS target_type) In this case, the expression represents the data that we wish to convert while the “target_type” specifies the data type to which we wish to convert. ...
As of MySQL 8.0.24, CAST() and CONVERT() support casting geometry values from one spatial type to another, for certain combinations of spatial types. For details, see Cast Operations on Spatial Types. TIME[(M)] Produces a TIME value. If the optional M value is given, it specifies th...
Besides the type CAST() function, you can use the following cast operator (::) to convert a value of one type into another: value::target_type In this syntax: value is a value that you want to convert. target_type specifies the target type that you want to cast the value to. The ...
An optional integer that specifies the length of the target data type, for data types that allow a user specified length. The default value is 30.styleAn integer expression that specifies how the CONVERT function will translate expression. For a style value of NULL, NULL is returned. data_...
Is an optional integer that specifies the length of the target data type. The default value is 30. style Is an integer expression that specifies how the CONVERT function is to translate expression. If style is NULL, NULL is returned. The range is determined by data_type. For more informatio...
Explore the SQL CAST function offered by all DBMS systems that follow the SQL standard and become a data type conversion wizard.