@@ -10,7 +10,7 @@ It does this by creating a temporary [Merge](https://clickhouse.com/docs/engines
10
10
11
11
<iframe width =" 768 " height =" 432 " src =" https://www.youtube.com/embed/b4YfRhD9SSI?si=MuoDwDWeikAV5ttk " title =" YouTube video player " frameborder =" 0 " allow =" accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share " referrerpolicy =" strict-origin-when-cross-origin " allowfullscreen ></iframe >
12
12
13
- ## Setup tables
13
+ ## Setup tables {#setup-tables}
14
14
15
15
We're going to learn how to use this function with help from [ Jeff Sackmann's tennis dataset] ( https://github.com/JeffSackmann/tennis_atp ) .
16
16
We're going to process CSV files that contain matches going back to the 1960s, but we'll create a slightly different schema for each decade.
@@ -46,8 +46,8 @@ SETTINGS schema_inference_make_columns_nullable=0,
46
46
schema_inference_hints= ' winner_seed Nullable(UInt16), loser_seed Nullable(UInt16), surface Enum(\' Hard\' , \' Grass\' , \' Clay\' , \' Carpet\' )' ;
47
47
```
48
48
49
- ## Schema of multiple tables
50
-
49
+ ## Schema of multiple tables {#schema-multiple-tables}
50
+
51
51
We can run the following query to list the columns in each table along with their types side by side, so that it's easier to see the differences.
52
52
53
53
``` sql
@@ -85,7 +85,7 @@ Let's go through the differences:
85
85
* 1980s changes ` winner_seed ` and ` loser_seed ` from ` Nullable(UInt8) ` to ` Nullable(UInt16) ` .
86
86
* 1990s changes ` surface ` from ` String ` to ` Enum('Hard', 'Grass', 'Clay', 'Carpet') ` and adds the ` walkover ` and ` retirement ` columns.
87
87
88
- ## Querying multiple tables with merge
88
+ ## Querying multiple tables with merge {#querying-multiple-tables}
89
89
90
90
Let's write a query to find the matches that John McEnroe won against someone who was seeded #1 :
91
91
@@ -141,7 +141,7 @@ The result of running the query is shown below:
141
141
└───────────────┴───────────────┴─────────────┘
142
142
```
143
143
144
- ## Which table do rows come from when using merge?
144
+ ## Which table do rows come from when using merge? {#which-table-merge}
145
145
146
146
What if we want to know which table rows come from?
147
147
We can use the ` _table ` virtual column to do this, as shown in the following query:
0 commit comments