How to convert function of Mysql number type

Mysql number type conversion function method: 1. Use the function concat to convert Int to varchar; 2. Use [cast(a as signed) a] to convert varchar to Int. More related free learning recommendation: mysql tutorial (video) Mysql number type Method of conversion function: 1. Convert Int to varchar often use the concat function, such as concat(8,'0') to get the string '80& #39; and MENU_NAME LIKE CONCAT(CONCAT('%', #{pd.keywords}),' %') 2. Convert varchar to Int and use cast(a as signed) a to varchar type string Summary: type conversion is the same as SQL Server, The type parameter is a bit different: CAST(xxx AS type), CONVERT(xxx, type) Available types Binary, same effect with binary prefix: BINARY Character type, can take parameters: CHAR() Date: DATE Time: TIME DateTime: DATETIME Float: DECIMAL Integer: SIGNED Unsigned Integer: UNSIGNED SELECT * from sys_menu where PARENT_ID='0' ORDER BY cast(MENU_NO as signed) When MENU_NO is a letter or Chinese character, the converted number is 0. 3. When we want to modify the sorting of a user list frequently, we need It is used when the serial number is a decimal. Because if it is an integer, then after adjusting the first one, all subsequent numbers must be adjusted. So we…

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: [email protected]

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索