1.Convert the number of a character to a number. For example, convert '0' to 0, which can be directly implemented by addition.
For example, sort d in the pony table and define d as varchar.
Select * from pony order by (d + 0)
2. when performing ifnull processing, for example, ifnull (a/B, '0') will cause a/B to become a string. Therefore, you need to change '0' to 0 to solve this problem.
3. When comparing numbers and varchar, such as a = 11, B = "11 ddddd ";
Select 11 = "11 ddddd" is equal
The comparison can be as follows:
Select binary 11 = binary "11 ddddd"
4. Character Set conversion: CONVERT (xxx USING gb2312)
Type conversion is similar to SQL Server, that is, the type parameters are a little different: CAST (xxx AS type), CONVERT (xxx, type), The type must use the following types:
Available types
Binary, with a BINARY Prefix: binary
Character type, with parameters: CHAR ()
DATE: DATE
TIME: TIME
DATETIME type
Floating Point: DECIMAL
Integer: SIGNED
UNSIGNED integer