请问columns表中的NUMERIC_PRECISION和NUMERIC_SCALE指的是什么?
例子如下:
drop database d1;
create database d1;
use d1;
create table t1(a tinyint, b tinyint(1), c tinyint(2), d tinyint(3), e tinyint(4));
use information_schema;
select table_name, column_name,data_type,numeric_precision, numeric_scale, column_type from columns where table_schema='d1';
结果如下:
+------------+-------------+-----------+-------------------+---------------+-------------+
| table_name | column_name | data_type | numeric_precision | numeric_scale | column_type |
+------------+-------------+-----------+-------------------+---------------+-------------+
| t1 | a | tinyint | 3 | 0 | tinyint(4) |
| t1 | b | tinyint | 3 | 0 | tinyint(1) |
| t1 | c | tinyint | 3 | 0 | tinyint(2) |
| t1 | d | tinyint | 3 | 0 | tinyint(3) |
| t1 | e | tinyint | 3 | 0 | tinyint(4) |
+------------+-------------+-----------+-------------------+---------------+-------------+
5 rows in set (0.00 sec)
为何numeric_precision都是3呢?