diff --git a/en/sql-reference/data-type/data-type-relational-db.md b/en/sql-reference/data-type/data-type-relational-db.md index 34beeee435e364b4f3188e5af81908c82982a84e..c583b554a01ef8a848ddede684c6d60ca0559801 100644 --- a/en/sql-reference/data-type/data-type-relational-db.md +++ b/en/sql-reference/data-type/data-type-relational-db.md @@ -46,6 +46,22 @@ KaiwuDB supports various signed integer data types. ::: +#### Data Type Conversions and Casts + +INTEGER-typed values can be cast to any of the following data types. + +| Type | Description | +| --- | --- | +| BIT | Convert the INTEGER-typed value to the corresponding binary value, and truncate or pad it according to the length of the converted BIT type. If the INTEGER type is shorter than the BIT type, add zero padding to the front of the data. | +| BOOL | `0` converts to `false`. All other values convert to `true`. | +| FLOAT | - | +| DECIMAL | - | +| STRING | Convert the INTEGER-typed value to the corresponding STRING-typed value and truncate it based on the converted STRING type. | +| DATE | Convert to days since Jan. 1, 1970. | +| TIMESTAMP | Convert to milliseconds since Jan. 1, 1970.| +| TIMESTAMPZ | Convert to milliseconds since Jan. 1, 1970. | +| INTERVAL | Convert to seconds since Jan. 1, 1970. | + #### Examples This example creates a table with INTEGER-typed columns. @@ -101,6 +117,19 @@ For example, - `'-Inf'::FLOAT` - `CAST('NaN' AS FLOAT)` +#### Data Type Conversions and Casts + +Floating-point-typed values can be cast to any of the following data types. + +| Type | Description | +| --- | --- | +| BOOL | `0` converts to `false`. All other values convert to `true`. | +| INT | The system returns an error if the value is NaN or +/- Inf.| +| FLOAT | Lose precision when converting the floating-point-typed value to the corresponding FLOAT4-typed value.| +| DECIMAL | Convert the floating-point-typed value to the corresponding DECIMAL-typed value and truncate it based on the converted DECIMAL type. | +| STRING | Convert the floating-point-typed value to the corresponding STRING-typed value and truncate it based on the converted STRING type.| +| INTERVAL | - | + #### Examples This example creates a table with floating-point-typed columns, inserts data into the table, and then uses the `CAST` function to limit the floating-point-typed columns. @@ -168,6 +197,18 @@ When inserting a DECIMAL value: - If the column's `precision` and `scale` are identical, the inserted value must round to less than 1. ::: +#### Data Type Conversions and Casts + +DECIMAL-typed values can be cast to any of the following data types. + +| Type | Description | +| --- | --- | +| BOOL | `0` converts to `false`. All other values convert to `true`. | +| INT | The system returns an error if the value is NaN or +/- Inf.| +| FLOAT | Lose precision when converting the DECIMAL-typed value to the corresponding FLOAT4-typed value.| +| STRING | Convert the DECIMAL-typed value to the corresponding STRING-typed value and truncate it based on the converted STRING type.| +| INTERVAL | - | + #### Examples This example creates a table with DECIMAL-typed columns and then inserts data into the table. @@ -264,6 +305,17 @@ A boolean value can be obtained by coercing a numeric value. Zero is coerced to - `CAST(0 AS BOOL) (false)` - `CAST(119 AS BOOL) (true)` +### Data Type Conversions and Casts + +BOOL-typed values can be cast to any of the following data types. + +| Type | Description | +| --- | --- | +| INT | Convert `true` to `1`, `false` to `0`.| +| FLOAT | Convert `true` to `1`, `false` to `0`.| +| DECIMAL | Convert `true` to `1`, `false` to `0`. | +| STRING | - | + ### Examples This example creates a table with BOOL-typed columns and then inserts data into the table. @@ -314,6 +366,16 @@ The BIT data type stores fixed-length bit arrays. Bit array constants are expres For BIT and BIT(N) types, the value must match exactly the specified size. Otherwise, KaiwuDB returns an error. The effective size of a BIT value is larger than its logical number of bits by a bounded constant factor. Internally, KaiwuDB stores bit arrays in increments of 64 bits plus an extra integer value to encode the length. The total size of a BIT value can be arbitrarily large, but it is recommended to keep values under 1 MB to ensure performance. Above that threshold, write amplification and other considerations may cause significant performance degradation. +#### Data Type Conversions and Casts + +BIT-typed values can be cast to any of the following data types. + +| Type | Description | +| --- | --- | +| VARBIT | Convert the BIT-typed value to the corresponding VARBIT-typed value, and truncate or pad it according to the length of the converted VARBIT type. If the BIT type is shorter than the VARBIT type, add zero padding to the end of the data. | +| INT | Convert the BIT-typed value to the corresponding INTEGER-typed value and get the value of the BIT type according to the length of the converted INTEGER type. | +| STRING | Convert the BIT-typed value to the corresponding STRING-typed value and truncate it based on the converted STRING type. | + #### Examples This example creates a table with BIT-typed columns and then inserts data into the table. @@ -415,6 +477,15 @@ In addition to the above syntaxes, KaiwuDB also supports using string literals, The size of a BYTES value is variable, but it is recommended to keep values under 1 MB to ensure performance. Above that threshold, write amplification and other considerations may cause significant performance degradation. +#### Data Type Conversions and Casts + +BYTES-typed values can be cast to any of the following data types. + +| Type | Description | +| --- | --- | +| STRING | Convert the BYTES-typed value to the corresponding STRING-typed value and truncate it based on the converted STRING type.| +| UUID | - | + #### Examples This example creates a table with BYTES-typed columns and then inserts data into the table. @@ -886,6 +957,20 @@ TIMESTAMP constants respresent specific date and time. In general, the TIMESTAMP KaiwuDB supports addition and substraction operations of time in queries for timestamp-typed columns or timestamp constants, and for functions and expressions whose result is timestamp. KaiwuDB supports comparing the operation results using the greater than sign (`>`), the less than sign (`<`), the equals sign (`=`), the greater than or equal to sign (`>=`), and the less than or equal to sign (`<=`). For details, see [Simple Query](../dml/relational-db/relational-select.md). +#### Data Type Conversions and Casts + +TIMESTAMP-typed values can be cast to any of the following data types. + +| Type | Description | +| --- | --- | +| INT | The system returns an error if the value is NaN or +/- Inf. | +| FLOAT | Convert to milliseconds since Jan. 1, 1970. | +| DECIMAL | Convert to seconds since Jan. 1, 1970. | +| STRING | - | +| DATE | Convert to the date portion (`YYYY-MM-DD`) of the timestamp. | +| TIME | Convert to the time portion (`HH:MM:SS`) of the timestamp. | +| TIMESTAMPZ | - | + #### Examples This example creates a table with TIMESTAMP-typed and TIMESTAMPTZ-typed columns. @@ -926,6 +1011,18 @@ c1|c2 |c3 The DATE data type stores a year, month, and day. You can express a constant value of the DATE type using an interpreted literal, or a string literal annotated with the DATE type or coerced to the DATE type. KaiwuDB also supports using uninterpreted string literals to express a DATE value. By default, KaiwuDB parses the `YYYY-MM-DD` string format for dates, such as `DATE '2016-12-23'`. A DATE-typed column supports values up to 16 bytes in width, but the total storage size is likely to be larger due to KaiwuDB metadata. +#### Data Type Conversions and Casts + +DATE-typed values can be cast to any of the following data types. + +| Type | Description | +| --- | --- | +| INT | The system returns an error if the value is NaN or +/- Inf. | +| FLOAT | - | +| DECIMAL | - | +| STRING | - | +| TIMESTAMPZ/TIMESTAMPZ | - | + #### Examples This example creates a table with DATE-typed columns and then inserts data into the table. @@ -983,6 +1080,15 @@ The TIME data type stores the time of day in UTC. A constant value of the TIME type can be expressed using an interpreted literal, or a string literal annotated with the TIME type or coerced to the TIME type. KaiwuDB also supports using uninterpreted string literals to express a TIME value. The string format for TIME is `HH:MM:SS.SSSSSS`, such as `TIME '05:40:00.000001'`. The fractional portion is optional and is rounded to microseconds (i.e., six digits after the decimal). A TIME-typed column supports values up to 8 bytes in width, but the total storage size is likely to be larger due to KaiwuDB metadata. +#### Data Type Conversions and Casts + +TIME-typed values can be cast to any of the following data types. + +| Type | Description | +| --- | --- | +| STRING | - | +| INTERVAL | - | + #### Examples This example creates a table with TIME-typed columns and then inserts data into the table. @@ -1040,6 +1146,18 @@ INTERVAL constants can be expressed using the following formats: An INTERVAL-typed column supports values up to 24 bytes in width, but the total storage size is likely to be larger due to KaiwuDB metadata. Intervals are stored internally as months, days, and microseconds. Therefore, a value parsed from a string value or converted from a floating-point or DECIMAL value is rounded to the nearest microsecond. Any operations (addition, subtraction, multiplication, division) performed on an INTERVAL value will also be rounded to the nearest microsecond. +#### Data Type Conversions and Casts + +INTERVAL-typed values can be cast to any of the following data types. + +| Type | Description | +| --- | --- | +| INT | The system returns an error if the value is NaN or +/- Inf. | +| FLOAT | Convert to seconds since Jan. 1, 1970. | +| DECIMAL | Convert to seconds since Jan. 1, 1970. | +| STRING | - | +| TIME | Convert to the time portion (`HH:MM:SS`) after the midnight. | + #### Examples This example creates a table with INTERVAL-typed columns and then inserts data into the table. @@ -1102,6 +1220,10 @@ There are six types of JSONB values: - Array: an ordered sequence of JSONB values - Object: a mapping from strings to JSONB values, such as `'{"type": "account creation", "username": "harvestboy93"}'` or `'{"first_name": "Ernie", "status": "Looking for treats", "location": "Brooklyn"}'`. If duplicate keys are included in the input, only the last value is kept. +### Data Type Conversions and Casts + +JSONB-typed values can be cast to STRING-typed values. + ### Examples Example 1: This example creates a table with a JSONB-typed column and then inserts data into the table. @@ -1351,6 +1473,16 @@ You can express UUID values using the following formats: A UUID value is 128 bits in width, but the total storage size is likely to be larger due to KaiwuDB metadata. +### Data Type Conversions and Casts + +UUID-typed values can be cast to any of the following data types. + +| Type | Description | +| --- | --- | +| DECIMAL | - | +| STRING | Convert the UUID-typed value to the corresponding STRING-typed value and truncate it based on the converted STRING type. | +| BYTES | - | + ### Examples Example 1: This example creates a table with a UUID-typed column and then inserts data into the table. diff --git a/en/sql-reference/data-type/data-type-ts-db.md b/en/sql-reference/data-type/data-type-ts-db.md index 96fd70bc7f045cdb2ff1b4684dedbac0202c37fa..a8e8862782fe4d1480525c51b478570fe280333b 100644 --- a/en/sql-reference/data-type/data-type-ts-db.md +++ b/en/sql-reference/data-type/data-type-ts-db.md @@ -69,6 +69,26 @@ Currently, KaiwuDB supports inserting a timestamp using any of the following way KaiwuDB supports addition and substraction operations of time in queries for timestamp-typed columns or timestamp constants, and for functions and expressions whose result is timestamp. KaiwuDB supports comparing the operation results using the greater than sign (`>`), the less than sign (`<`), the equals sign (`=`), the greater than or equal to sign (`>=`), and the less than or equal to sign (`<=`). For details, see [Simple Query](../dml/ts-db/ts-select.md). +### Data Type Conversions and Casts + +TIMESTAMP-typed values can be cast to any of the following data types. + +| Type | Description | +| --- | --- | +| INT | The system returns an error if the value is NaN or +/- Inf. | +| FLOAT | Convert to milliseconds since Jan. 1, 1970. | +| STRING | - | +| TIMESTAMPZ | - | + +TIMESTAMPZ-typed values can be cast to any of the following data types. + +| Type | Description | +| --- | --- | +| INT | The system returns an error if the value is NaN or +/- Inf. | +| FLOAT | Convert to milliseconds since Jan. 1, 1970. | +| STRING | - | +| TIMESTAMP | - | + ### Examples - Create a table with TIMESTAMP-typed and TIMESTAMPTZ-typed columns. @@ -132,6 +152,18 @@ KaiwuDB supports various signed integer data types. A constant value of an integer type can be entered as a numeric literal. For example, `42`, `-1234` or `0xCAFE`. ::: +#### Data Type Conversions and Casts + +INTEGER-typed values can be cast to any of the following data types. + +| Type | Description | +| --- | --- | +| BOOL | `0` converts to `false`. All other values convert to `true`. | +| FLOAT | - | +| STRING | Convert the INTEGER-typed value to the corresponding STRING-typed value and truncate it based on the converted STRING type. | +| TIMESTAMP | Convert to milliseconds since Jan. 1, 1970.| +| TIMESTAMPZ | Convert to milliseconds since Jan. 1, 1970.| + #### Examples This example creates a table with INTEGER-typed columns. @@ -177,6 +209,16 @@ A FLOAT-typed column supports values up to 8 bytes in width, but the total stora To limit a FLOAT-typed column, use `CAST(column as DECIMAL(precision, scale))`, where `precision` is the maximum count of digits both to the left and right of the decimal point and `scale` is the exact count of digits to the right of the decimal point. The `precision` must not be smaller than the `scale`. Using `DECIMAL(precision)` is equivalent to `DECIMAL(precision, 0)`. +#### Data Type Conversions and Casts + +Floating-point-typed values can be cast to any of the following data types. + +| Type | Description | +| --- | --- | +| BOOL | `0` converts to `false`. All other values convert to `true`. | +| FLOAT | Lose precision when converting the floating-point-typed value to the corresponding FLOAT4-typed value.| +| STRING | Convert the floating-point-typed value to the corresponding STRING-typed value and truncate it based on the converted STRING type. | + #### Examples This example creates a table with floating-point-typed columns, inserts data into the table, and then uses the `CAST` function to limit the floating-point-typed columns. @@ -238,6 +280,16 @@ A boolean value can be obtained by coercing a numeric value. Zero is coerced to - `CAST(0 AS BOOL) (false)` - `CAST(119 AS BOOL) (true)` +### Data Type Conversions and Casts + +BOOL-typed values can be cast to any of the following data types. + +| Type | Description | +| --- | --- | +| INT | Convert `true` to `1`, `false` to `0`.| +| FLOAT | Convert `true` to `1`, `false` to `0`.| +| STRING | - | + ### Examples This example creates a table with BOOL-typed columns. diff --git a/en/sql-reference/functions/functions-relational-db.md b/en/sql-reference/functions/functions-relational-db.md index e2404c3e7906bcf5805aa3dedc77bf5515ca188c..0c435b07ef3f94d5980ffcaf20d10bd823141eb3 100644 --- a/en/sql-reference/functions/functions-relational-db.md +++ b/en/sql-reference/functions/functions-relational-db.md @@ -54,8 +54,8 @@ This table lists the operators that look like built-in functions but have specia | `COALESCE(...)` | First non-NULL expression with short circuit | | `EXISTS(...)` | Existence test on the result of subqueries | | `IF(...)` | Conditional evaluation | -| `IFNULL(...)` | Alias for `COALESCE` restricted to two operands | -| `NULLIF(...)` | Return NULL conditionally | +| IFNULL(...) | Alias for `COALESCE` restricted to two operands
**Note**
- When both operands are explicitly declared, they must have the same type. ​Otherwise, the system cannot evaluate them.
- When one operand is explicitly declared and the other operand is a constant, the system converts the constant to the specified data type and then evaluates them. If failed to convert, the system returns an error.
- When both operands are constants, the system evaluates the operands if they have the same type (numeric or string type). If one operand is a numeric constant and the other one is a string-typed constant, the system converts the string-typed constant to the numeric-typed constant and then evaluates them. If failed to convert, the system returns an error. | +| NULLIF(...) | Return NULL conditionally
**Note**
- When both operands are explicitly declared, they must have the same type. ​Otherwise, the system cannot evaluate them.
- When one operand is explicitly declared and the other operand is a constant, the system converts the constant to the specified data type and then evaluates them. If failed to convert, the system returns an error.
- When both operands are constants, the system evaluates the operands if they have the same type (numeric or string type). If one operand is a numeric constant and the other one is a string-typed constant, the system converts the string-typed constant to the numeric-typed constant and then evaluates them. If failed to convert, the system returns an error. | | `ROW(...)` | Tuple constructor | ## Buit-in Functions diff --git a/en/sql-reference/functions/functions-ts-db.md b/en/sql-reference/functions/functions-ts-db.md index 9a0bd5fd7015297d63fa807fcad34b04d89d9554..3b73085485ea6a490f53a10d4909a3202755d0b8 100644 --- a/en/sql-reference/functions/functions-ts-db.md +++ b/en/sql-reference/functions/functions-ts-db.md @@ -52,8 +52,8 @@ This table lists the operators that look like built-in functions but have specia | Operator | Description | | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | | CAST(...) | Type cast
**Note**
- When creating a time-series table, if the data type of the TIMESTAMPT-typed column is set to TIMESTAMP, the system will automatically process it as TIMESTAMPTZ, and the conversion of this column will be done according to the time zone set by KaiwuDB.
- When using the `CAST` function to convert a CHAR, NCHAR or VARCHAR data type to a CHAR, NCHAR or VARCHAR data type with a different length, if the target length does not match the actual number of bytes in the original string, KaiwuDB may return garbled code, and the client side (e.g., KaiwuDB JDBC or KaiwuDB Developer Center) will prompt an error. | -| IFNULL(...) | Alias for `COALESCE` restricted to two operands. | -| NULLIF(...) | Return NULL conditionally. | +| IFNULL(...) | Alias for `COALESCE` restricted to two operands
**Note**
- When both operands are explicitly declared, they must have the same type. ​Otherwise, the system cannot evaluate them.
- When one operand is explicitly declared and the other operand is a constant, the system converts the constant to the specified data type and then evaluates them. If failed to convert, the system returns an error.
- When both operands are constants, the system evaluates the operands if they have the same type (numeric or string type). If one operand is a numeric constant and the other one is a string-typed constant, the system converts the string-typed constant to the numeric-typed constant and then evaluates them. If failed to convert, the system returns an error. | +| NULLIF(...) | Return NULL conditionally
**Note**
- When both operands are explicitly declared, they must have the same type. ​Otherwise, the system cannot evaluate them.
- When one operand is explicitly declared and the other operand is a constant, the system converts the constant to the specified data type and then evaluates them. If failed to convert, the system returns an error.
- When both operands are constants, the system evaluates the operands if they have the same type (numeric or string type). If one operand is a numeric constant and the other one is a string-typed constant, the system converts the string-typed constant to the numeric-typed constant and then evaluates them. If failed to convert, the system returns an error. | ## Buit-in Functions diff --git a/kat/kat-examples.md b/kat/kat-examples.md index e7f8345309d5de0f93b5ba7e55f64ce2a7545947..7482f3ad0515bdef67c04374a36d2ad42059d710 100644 --- a/kat/kat-examples.md +++ b/kat/kat-examples.md @@ -17,7 +17,7 @@ id: kat-examples 以下示例假设已经创建一个数据库(`iot`)和 一张表(`sensor_data`)。用户向 `sensor_data` 表中写入五条记录。 -在 KAT 对话页面,用户输入一个问题:“向 sendor_data 表中插入五条数据”。KAT 配置的大模型将其转化为可执行的 SQL 语句: +在 KAT 对话页面,用户输入一个问题:“向 sensor_data 表中插入五条数据”。KAT 配置的大模型将其转化为可执行的 SQL 语句: ```sql INSERT INTO iot.sensor_data (ts, temperature, humidity, sensor_id, sensor_type) VALUES diff --git a/sql-reference/data-type/data-type-relational-db.md b/sql-reference/data-type/data-type-relational-db.md index e235b2163ececf57cb913e5e640bc9f2a0489ecc..49821782b5ddc55fe04534e7a1b23dacded829e7 100644 --- a/sql-reference/data-type/data-type-relational-db.md +++ b/sql-reference/data-type/data-type-relational-db.md @@ -50,7 +50,7 @@ KaiwuDB 支持有符号的整数数据类型。 整数类型的数据可以转换为以下任何一种数据类型。 -| Type | 描述 | +| 类型 | 描述 | | --- | --- | | BIT | 将十进制数值转换为二进制数值,并根据转换后的 BIT 类型的长度进行截断或补齐。补齐方式为在数据前面补零。| | BOOL | 非零的值转换为 `true`,零转换为 `false`。 | @@ -121,7 +121,7 @@ FLOAT 列存储最多 8 个字节的值。但由于元数据的影响,实际 浮点类型的数据可以转换为以下任何一种数据类型。 -| Type | 描述 | +| 类型 | 描述 | | --- | --- | | BOOL | 非零的值转换为 `true`,零转换为 `false`。 | | INT | 超出转换类型的范围时,系统报错。| @@ -202,12 +202,11 @@ DECIMAL 列支持使用 `DECIMAL(precision, scale)` 对数值进行限制。其 定点类型的数据可以转换为以下任何一种数据类型。 -| Type | 描述 | +| 类型 | 描述 | | --- | --- | | BOOL | 非零的值转换为 `true`,零转换为 `false`。 | | INT | 超出转换类型的范围时,系统报错。| | FLOAT | 转换为 FLOAT4 类型时,会损失精度。| -| DECIMAL | 根据转换后的 STRING 类型的长度进行截断。 | | STRING | 根据转换后的 STRING 类型的长度进行截断。 | | INTERVAL | - | @@ -315,7 +314,7 @@ SELECT * FROM serial; 布尔类型的数据可以转换为以下任何一种数据类型。 -| Type | 描述 | +| 类型 | 描述 | | --- | --- | | INT | `true` 转换为 1,`false` 转换为 0。| | FLOAT | `true` 转换为 1,`false` 转换为 0。| @@ -376,7 +375,7 @@ BIT 数据类型用于存储固定长度的二进制位数组。位数组常量 BIT 类型的数据可以转换为以下任何一种数据类型。 -| Type | 描述 | +| 类型 | 描述 | | --- | --- | | VARBIT | 根据数据长度进行截断或补齐。补齐方式为末尾补零。 | | INT | 二进制数值转换成十进制数值。根据 INT 类型的位数取 BIT 类型对应位数的值。| @@ -487,7 +486,7 @@ BYTES 数据类型存储指定长度的二进制字符串。向关系表中写 BYTES 类型的数据可以转换为以下任何一种数据类型。 -| Type | 描述 | +| 类型 | 描述 | | --- | --- | | STRING | 根据转换后的 STRING 类型的长度进行截断。 | | UUID | - | @@ -942,7 +941,7 @@ KaiwuDB 支持在查询中对列类型为时间戳、时间戳常量以及结果 TIMESTAMP 类型的数据可以转换为以下任何一种数据类型。 -| Type | 描述 | +| 类型 | 描述 | | --- | --- | | INT | 超出转换类型的范围时,系统报错。 | | FLOAT | 结果转换为毫秒数。 | @@ -954,7 +953,7 @@ TIMESTAMP 类型的数据可以转换为以下任何一种数据类型。 TIMESTAMPZ 类型的数据可以转换为以下任何一种数据类型。 -| Type | 描述 | +| 类型 | 描述 | | --- | --- | | INT | 超出转换类型的范围时,系统报错。 | | FLOAT | 结果转换为毫秒数。 | @@ -1008,7 +1007,7 @@ DATE 类型用于存储年、月、日信息。DATE 类型的常量值可以使 DATE 类型的数据可以转换为以下任何一种数据类型。 -| Type | 描述 | +| 类型 | 描述 | | --- | --- | | INT | 超出转换类型的范围时,系统报错。 | | FLOAT | - | @@ -1077,7 +1076,7 @@ TIME 类型的常量值可以使用解释文本、带有 TIME 类型注释的字 TIME 类型的数据可以转换为以下任何一种数据类型。 -| Type | 描述 | +| 类型 | 描述 | | --- | --- | | STRING | - | | INTERVAL | - | @@ -1142,7 +1141,7 @@ INTERVAL 列支持的最大宽度为 24 个字节。但是,由于元数据的 INTERVAL 类型的数据可以转换为以下任何一种数据类型。 -| Type | 描述 | +| 类型 | 描述 | | --- | --- | | INT | 超出转换类型的范围时,系统报错。 | | FLOAT | 结果转换为秒数。 | @@ -1465,7 +1464,7 @@ UUID 值的宽度为 128 位。但是,由于元数据的影响,实际存储 UUID 类型的数据可以转换为以下任何一种数据类型。 -| Type | 描述 | +| 类型 | 描述 | | --- | --- | | DECIMAL | - | | STRING | 根据转换后的 STRING 类型的长度进行截断。 | diff --git a/sql-reference/data-type/data-type-ts-db.md b/sql-reference/data-type/data-type-ts-db.md index dc21af2ab1c8520db3cddc9ea84e4b795d5c830d..d1e28b62248f00a367e8192ab4b7c487c54c50c6 100644 --- a/sql-reference/data-type/data-type-ts-db.md +++ b/sql-reference/data-type/data-type-ts-db.md @@ -71,7 +71,7 @@ KaiwuDB 支持在查询中对列类型为时间戳、时间戳常量以及结果 TIMESTAMP 类型的数据可以转换为以下任何一种数据类型。 -| Type | 描述 | +| 类型 | 描述 | | --- | --- | | INT | 超出转换类型的范围时,系统报错。 | | FLOAT | 结果转换为毫秒数。 | @@ -80,7 +80,7 @@ TIMESTAMP 类型的数据可以转换为以下任何一种数据类型。 TIMESTAMPZ 类型的数据可以转换为以下任何一种数据类型。 -| Type | 描述 | +| 类型 | 描述 | | --- | --- | | INT | 超出转换类型的范围时,系统报错。 | | FLOAT | 结果转换为毫秒数。 | @@ -156,7 +156,7 @@ KaiwuDB 支持有符号的整数数据类型。 整数类型的数据可以转换为以下任何一种数据类型。 -| Type | 描述 | +| 类型 | 描述 | | --- | --- | | BOOL | 非零的值转换为 `true`,零转换为 `false`。 | | FLOAT | - | @@ -213,7 +213,7 @@ FLOAT 列支持在查询时通过 `CAST(column as DECIMAL(precision, scale))` 浮点类型的数据可以转换为以下任何一种数据类型。 -| Type | 描述 | +| 类型 | 描述 | | --- | --- | | BOOL | 非零的值转换为 `true`,零转换为 `false`。 | | FLOAT | 转换为 FLOAT4 类型时,会损失精度。| @@ -284,7 +284,7 @@ c1 |c2 布尔类型的数据可以转换为以下任何一种数据类型。 -| Type | 描述 | +| 类型 | 描述 | | --- | --- | | INT | `true` 转换为 1,`false` 转换为 0。| | FLOAT | `true` 转换为 1,`false` 转换为 0。|