> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-parallel-read-in-order-multi-part.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> ClickHouse 中有符号和无符号整数数据类型的文档， 范围从 8 位到 256 位

# Int | UInt 类型

ClickHouse 提供多种定长整数类型，
包括有符号整数 (`Int`) 和无符号整数 (`UInt`) ，范围从 1 字节到 32 字节。

创建表时，可以为整数类型设置数值参数 (例如 `TINYINT(8)`、`SMALLINT(16)`、`INT(32)`、`BIGINT(64)`) ，但 ClickHouse 会忽略这些参数。

<div id="integer-ranges">
  ## 整数取值范围
</div>

整数类型的取值范围如下：

| 类型 | 范围 |
| - | - |
| `Int8` | \[-128 : 127] |
| `Int16` | \[-32768 : 32767] |
| `Int32` | \[-2147483648 : 2147483647] |
| `Int64` | \[-9223372036854775808 : 9223372036854775807] |
| `Int128` | \[-170141183460469231731687303715884105728 : 170141183460469231731687303715884105727] |
| `Int256` | \[-57896044618658097711785492504343953926634992332820282019728792003956564819968 : 57896044618658097711785492504343953926634992332820282019728792003956564819967] |

无符号整数类型的取值范围如下：

| 类型 | 范围 |
| - | - |
| `UInt8` | \[0 : 255] |
| `UInt16` | \[0 : 65535] |
| `UInt32` | \[0 : 4294967295] |
| `UInt64` | \[0 : 18446744073709551615] |
| `UInt128` | \[0 : 340282366920938463463374607431768211455] |
| `UInt256` | \[0 : 115792089237316195423570985008687907853269984665640564039457584007913129639935] |

<div id="integer-aliases">
  ## 整数别名
</div>

整数类型有以下别名：

| 类型 | 别名 |
| - | - |
| `Int8` | `TINYINT`, `INT1`, `BYTE`, `TINYINT SIGNED`, `INT1 SIGNED` |
| `Int16` | `SMALLINT`, `SMALLINT SIGNED` |
| `Int32` | `INT`, `INTEGER`, `MEDIUMINT`, `MEDIUMINT SIGNED`, `INT SIGNED`, `INTEGER SIGNED` |
| `Int64` | `BIGINT`, `SIGNED`, `BIGINT SIGNED` |

无符号整数类型有以下别名：

| 类型 | 别名 |
| - | - |
| `UInt8` | `TINYINT UNSIGNED`, `INT1 UNSIGNED` |
| `UInt16` | `SMALLINT UNSIGNED`, `YEAR` |
| `UInt32` | `MEDIUMINT UNSIGNED`, `INT UNSIGNED`, `INTEGER UNSIGNED` |
| `UInt64` | `UNSIGNED`, `BIGINT UNSIGNED`, `BIT`, `SET` |
