Original: http://www.2cto.com/database/201310/250880.htmlSQL cast and CONVERT usage detailed Summary: The following applies only to Mysqlselect {fn CONCAT (CONVERT (User_id,char), user_name)} as Str from T_SYS_ User following this applies only to
Replace, concat, and cast character string functions in mysql need to export a personal information of job-seeking users. This information requires three-table joint query requirements: birthdate format: 1990.01.02 Database: Gender display: men and
Count = integer. parseint (string) all. Get (0 ));
Execution error: Java. Lang. classcastexception: Java. Lang. Integer cannot be cast to Java. Lang. String
Solution: change the statement marked in red to Count = integer. parseint (all. Get (0).
The MYSQL Cast function is a very important MYSQL function. The following describes the syntax and usage of the MYSQL Cast function in detail, hoping that you can have a better understanding of the MYSQL Cast function.
BINARYThe BINARY operator
The cast () function can be used to convert data types.The CAST () function has two parameters, the source value and the target data type, separated by the AS keyword.The following examples are tested by me.One, convert columns or valuesSyntax: Cast
The cast () function can be used to convert data types. The CAST () function has two parameters, the source value and the target data type, separated by the AS keyword. The following examples are tested by me. First, convert a column or value Syntax:
Get data type:1. If you want to see the value and type of an expression, use Var_dump ().2. If you just want an easy-to-read type of expression for debugging, use GetType ().3. To view a type, do not use GetType () and use the Is_type ()
The cast function is used to explicitly convert an expression of a data type to another data type. The argument to the CAST () function is an expression that includes the source value and the target data type separated by the AS keyword. Syntax:CAST
The cast function is used to explicitly convert an expression of a data type to another data type. The argument to the CAST () function is an expression that includes the source value and the target data type separated by the AS keyword.First, the
First, the syntax:CAST (expression as data_type)Parameter description:expression: Any valid Sqserver expression.as: Used to separate two parameters, before as is the data to be processed, after as is the type of data to be converted.data_type: The
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.