File tree Expand file tree Collapse file tree 2 files changed +46
-3
lines changed Expand file tree Collapse file tree 2 files changed +46
-3
lines changed Original file line number Diff line number Diff line change 950
950
- [ GROUP BY 聚合函数] ( /functions-and-operators/aggregate-group-by-functions.md )
951
951
- [ GROUP BY 修饰符] ( /functions-and-operators/group-by-modifier.md )
952
952
- [ 窗口函数] ( /functions-and-operators/window-functions.md )
953
+ - [ 序列函数] ( /functions-and-operators/sequence-functions.md )
954
+ - [ 效用函数] ( /functions-and-operators/utility-functions.md )
953
955
- [ 其它函数] ( /functions-and-operators/miscellaneous-functions.md )
956
+ - [ TiDB 特有的函数] ( /functions-and-operators/tidb-functions.md )
954
957
- [ 精度数学] ( /functions-and-operators/precision-math.md )
955
958
- [ 集合运算] ( /functions-and-operators/set-operators.md )
956
- - [ 序列函数] ( /functions-and-operators/sequence-functions.md )
957
- - [ 下推到 TiKV 的表达式列表] ( /functions-and-operators/expressions-pushed-down.md )
958
- - [ TiDB 特有的函数] ( /functions-and-operators/tidb-functions.md )
959
+ - [ 下推到 TiKV 的表达式列表] ( /functions-and-operators/expressions-pushed-down.md )
959
960
- [ Oracle 与 TiDB 函数和语法差异对照] ( /oracle-functions-to-tidb.md )
960
961
- [ 聚簇索引] ( /clustered-indexes.md )
961
962
- [ 约束] ( /constraints.md )
Original file line number Diff line number Diff line change
1
+ ---
2
+ title : 效用函数
3
+ summary : 了解 TiDB 中的效用函数。
4
+ ---
5
+
6
+ # 效用函数
7
+
8
+ 本文介绍了 TiDB 支持的效用函数,这些函数旨在简化常见数据转换,使结果更易于阅读和理解。
9
+
10
+ ## ` FORMAT_BYTES() `
11
+
12
+ ` FORMAT_BYTES() ` 函数用于将字节数格式化为易于阅读的形式。
13
+
14
+ ``` sql
15
+ SELECT FORMAT_BYTES(10 * 1024 * 1024 );
16
+ ```
17
+
18
+ ```
19
+ +----------------------------+
20
+ | FORMAT_BYTES(10*1024*1024) |
21
+ +----------------------------+
22
+ | 10.00 MiB |
23
+ +----------------------------+
24
+ 1 row in set (0.001 sec)
25
+ ```
26
+
27
+ ## ` FORMAT_NANO_TIME() `
28
+
29
+ ` FORMAT_NANO_TIME() ` 函数用于将纳秒数格式化为易于阅读的时间形式。
30
+
31
+ ``` sql
32
+ SELECT FORMAT_NANO_TIME(1000000 );
33
+ ```
34
+
35
+ ```
36
+ +---------------------------+
37
+ | FORMAT_NANO_TIME(1000000) |
38
+ +---------------------------+
39
+ | 1.00 ms |
40
+ +---------------------------+
41
+ 1 row in set (0.001 sec)
42
+ ```
You can’t perform that action at this time.
0 commit comments