Considerations for MySQL type conversion

Source: Internet
Author: User
Tags mssqlserver
One of the most recent tasks is to rewrite the services that used the MSSQLServer database to support MySQL databases. SQL statements involve some type conversion functions, the result shows that the MySQL type conversion function CONVERT does not provide good compatibility with data type names, and the parameter order is also different! Use convert (int, Por in SQLServer

One of the most recent tasks is to rewrite the services that used the MSSQLServer database to support MySQL databases. SQL statements involve some type conversion functions, the result shows that the MySQL type conversion function CONVERT does not provide good compatibility with data type names, and the parameter order is also different! Use convert (int, Por in SQLServer

One of the most recent tasks is to use the MSSQLServer database service,

To support MySQL databases, SQL statements involve some type conversion functions,

The result shows that the MySQL type conversion function "CONVERT" does not provide good compatibility with data type names,

The Parameter order is also different!

Use convert (int, Port) in SQLServer, and use convert (Port, SIGNED) AS 'Port' in MySQL'

Note: If the column name in the result set is not added AS 'Port', it will be displayed AS convert (port, SIGNED)

SQL Server uses brackets [] to solve special symbols, keywords, and other problems, but MySQL needs to use single quotes ·

It is also called a short period. It is also a weighing note, that is, the key under Esc in the upper left corner of the keyboard. If you enter it, you do not press Shift.

Note the Data Type Used for conversion. This type can be one of the following values:

BINARY [(N)]

CHAR [(N)]

DATE

DATETIME

DECIMAL

SIGNED [INTEGER]

TIME

UNSIGNED [INTEGER]

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.