提交 2ab4fe0a 编写于 作者: M Mars Liu

window function

上级 cc99a785
...@@ -3,5 +3,5 @@ ...@@ -3,5 +3,5 @@
"author": "ccat", "author": "ccat",
"source": "create_user.md", "source": "create_user.md",
"notebook_enable": false, "notebook_enable": false,
"exercise_id": "70eadd97073640d5ac486898c7294d34" "exercise_id": "fd2caef1500e4917901a76644f7c81d0"
} }
\ No newline at end of file
{ {
"node_id": "mysql-5ccb985581644784ae82118849bc241c", "node_id": "mysql-5ccb985581644784ae82118849bc241c",
"keywords": ["window function", "窗口函数"], "keywords": [
"window function",
"窗口函数"
],
"children": [], "children": [],
"export": [], "export": [
"head.json",
"rank.json",
"within.json",
"distrubute.json"
],
"keywords_must": [], "keywords_must": [],
"keywords_forbid": [], "keywords_forbid": [],
"group": 0 "group": 2
} }
\ No newline at end of file
{
"type": "code_options",
"author": "ccat",
"source": "distribute.md",
"notebook_enable": false,
"exercise_id": "70eadd97073640d5ac486898c7294d34"
}
\ No newline at end of file
{
"type": "code_options",
"author": null,
"source": "distrubute.md",
"notebook_enable": false,
"exercise_id": "815be880ae8141f9b562638e167dcedb"
}
\ No newline at end of file
# 分布函数
关于分布函数,以下说法正确的是
1. `PERCENT_RANK()`函数是等级值百分比函数。
2. `CUME_DIST()`函数主要用于查询小于或等于某个值的比例
3. `PERCENT_RANK() `按照 ` (rank - 1) / (rows - 1)` 计算, 其中,rank的值为使用RANK()函数产生的序号,rows的值为当前窗口的总记录数。
## 答案
全部都对
## 选项
### A
```
1, 2
```
### B
```
2, 3
```
### C
全都不对
\ No newline at end of file
{
"type": "code_options",
"author": "ccat",
"source": "head.md",
"notebook_enable": false,
"exercise_id": "70eadd97073640d5ac486898c7294d34"
}
\ No newline at end of file
# 首尾
关于 window function 的首尾操作,以下说法正确的是:
1. FIRST_VALUE(expr)函数返回第一个expr的值。
2. LAST_VALUE(expr)函数返回最后一个expr的值。
## 答案
全部都对
## 选项
### A
全都不对
### C
1
### D
2
\ No newline at end of file
{
"type": "code_options",
"author": "ccat",
"source": "rank.md",
"notebook_enable": false,
"exercise_id": "660b68ab2651450ba2572c03221ca2c9"
}
\ No newline at end of file
# RANK
关于 window function 的序号操作,以下说法正确的是:
1. `ROW_NUMBER()`函数能够对数据中的序号进行顺序显示。
2. 使用`RANK()`函数能够对序号进行并列排序,并且会跳过重复的序号
3. `DENSE_RANK()`函数对序号进行并列排序,并且不会跳过重复的序号
4. `RANK()` 函数可能输出形如 `1, 2, 2, 4` 的数列
5. `DNSE_RANK()` 函数可能输出形如 `1, 2, 2, 3` 的数列
## 答案
以上都对
## 选项
### A
以上都不对
### B
```
1, 2, 3
```
### C
```
4, 5
```
\ No newline at end of file
{
"type": "code_options",
"author": "ccat",
"source": "within.md",
"notebook_enable": false,
"exercise_id": "94fe246370d3454a8e57c9fd8a44c59b"
}
\ No newline at end of file
# 向前和向后
关于向前和向后取值,以下说法正确的是:
1. `LAG(expr,n)`函数返回当前行的前n行的expr的值。
2. `LEAD(expr,n)`函数返回当前行的后n行的expr的值。
## 答案
全部都对
## 选项
### A
全都不对
### C
1
### D
2
\ No newline at end of file
...@@ -886,7 +886,7 @@ ...@@ -886,7 +886,7 @@
"children": [], "children": [],
"keywords_must": [], "keywords_must": [],
"keywords_forbid": [], "keywords_forbid": [],
"group": 0 "group": 2
} }
}, },
{ {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册