Update ch08: 秋招秘籍 C.md

This commit is contained in:
mba1398
2021-07-07 18:46:19 +08:00
committed by GitHub
parent 97ad72f066
commit bfc54790bd

View File

@@ -1 +1,31 @@
11
# 练习一:行转列
假设有如下比赛结果
```plain
+------------+-----------+
| cdate | result |
+------------+-----------+
| 2021-1-1 | 胜 |
| 2021-1-1 | 负 |
| 2021-1-3 | 胜 |
| 2021-1-3 | 负 |
| 2021-1-1 | 胜 |
| 2021-1-3 | 负 |
+------------+-----------+
```
请使用 SQL 根据比赛结果生成如下结果:
+------------+-----+-----|
| 比赛日期 | 胜 | 负 |
+------------+-----------+
| 2021-1-1 | 2 | 1 |
| 2021-1-2 | 2 | 1 |