根据以下说法,数据由低优先级向高优先级转化:
When an operator combines two expressions of different data types, the rules for data type precedence specify that the data type with the lower precedence is converted to the data type with the higher precedence.
部分数据类型优先级顺序如下图:
用mysql进行测试,结果却不符合由低到高转换的说法:
mysql> select*from testu;
+---+---+
| a | b |
+---+---+
| 1 | a |
| 2 | b |
+---+---+
2 rows in set
mysql> create table `ttt` select `a` from `testU` union select `b` from `testU`;
Query OK, 4 rows affected
Records: 4 Duplicates: 0 Warnings: 0
mysql> select*from `ttt`;
+---+
| a |
+---+
| 1 |
| 2 |
| a |
| b |
+---+
4 rows in set