示例
mysql> Create table testing Select IFNULL(100,'testing123');
Query OK, 1 row affected (0.18 sec)
Records: 1 Duplicates: 0 Warnings: 0
mysql> Select * from testing568;
+-----------------------+
| IFNULL(100,'testing') |
+-----------------------+
| 100 |
+-----------------------+
1 row in set (0.00 sec)
mysql> Describe testing568;
+-----------------------+------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-----------------------+------------+------+-----+---------+-------+
| IFNULL(100,'testing') | varchar(7) | NO | | | |
+-----------------------+------------+------+-----+---------+-------+
1 row in set (0.03 sec)
登录后复制
从上面的结果集中可以清楚地看出,在本例中,列的类型是 varchar(7)。也就是说,它是字符串类型。
以上就是MySQL IFNULL() 控制流运算符的默认返回类型是什么?的详细内容,更多请关注每日运维网(www.mryunwei.com)其它相关文章!