我相信这Numeric_Precision_Radix
是在 SQL-99 标准指定的 Information_Schema.Columns 表中指定的。
每个 DBMS 都会有所不同。根据此链接,它被指定为:
如果 data_type 标识数字类型,则此列指示 numeric_precision 和 numeric_scale 列中的值以哪个基表示。该值为 2 或 10。对于所有其他数据类型,此列为空。
对于 SQL Server,它是 10int
和money
2decimal
和float
& real
。请参见下面的示例,其中基数为 2 且精度为 53 的浮点数,这意味着它精确到 53 位信息。
换句话说,对于 int 精度以 10 的 10 次方表示,但实际上它表示为 2 的 53 次方。
在此处查看 wiki链接
SQL小提琴
MS SQL Server 2008 架构设置:
CREATE TABLE MyRadix
(
aInt int,
bFloat float,
cMoney Money,
dDecimal Decimal(12,10),
eReal Real
)
查询 1:
SELECT COLUMN_NAME, DATA_TYPE, NUMERIC_PRECISION_RADIX, NUMERIC_PRECISION, NUMERIC_SCALE
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = 'MyRAdix'
结果:
| COLUMN_NAME | DATA_TYPE | NUMERIC_PRECISION_RADIX | NUMERIC_PRECISION | NUMERIC_SCALE |
|-------------|-----------|-------------------------|-------------------|---------------|
| aInt | int | 10 | 10 | 0 |
| bFloat | float | 2 | 53 | (null) |
| cMoney | money | 10 | 19 | 4 |
| dDecimal | decimal | 10 | 12 | 10 |
| eReal | real | 2 | 24 | (null) |