MySQL CONV()函数中是否有基数的上限和下限?如果在CONV()函数中提供了超出限制的基数怎么办?
基数必须大于2且小于36,即基数的下限为2,上限为36。它同时应用于from_base和to_base值。如果万一我们提供了超出基准的极限值,那么MySQL将返回NULL作为输出。以下示例将演示它-
示例
mysql> Select CONV(10,10,38); +----------------+ | CONV(10,10,38) | +----------------+ | NULL | +----------------+ 1 row in set (0.00 sec) mysql> Select CONV(10,72,2); +---------------+ | CONV(10,72,2) | +---------------+ | NULL | +---------------+ 1 row in set (0.00 sec) mysql> Select CONV(10,10,1); +---------------+ | CONV(10,10,1) | +---------------+ | NULL | +---------------+ 1 row in set (0.00 sec)