> For the complete documentation index, see [llms.txt](https://userguide.cryptoquant.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://userguide.cryptoquant.com/vi/web3-analytics-tool/how-to-use/5.-query-block-join.md).

# 5. Query Block - Join

## Join <a href="#h_ec81a11271" id="h_ec81a11271"></a>

Join is used when you want to merge two tables within one Query Block. For example, you may want to use the Ethereum transaction table and the address label information from metadata. Using join, you can match the from or to address of the Ethereum transaction with the label to merge the tables.

### How to use

1. To activate the join input window, click on the +Join button at the top of the Query Block.

   [![](https://downloads.intercomcdn.com/i/o/687217841/31ae96050bf6615d7353d3b0/join1.png)](https://downloads.intercomcdn.com/i/o/687217841/31ae96050bf6615d7353d3b0/join1.png)
2. Select the new table you want to join in the table selection window.
3. You can change the Join option between the two tables. There are four Join options available: Inner, Left Outer, Right Outer, and Full Outer. The default option is Inner Join.

   [![](https://downloads.intercomcdn.com/i/o/687217613/46f6983d3d6eda1e24509000/join3.png)](https://downloads.intercomcdn.com/i/o/687217613/46f6983d3d6eda1e24509000/join3.png)

   1. Inner Join: Inner Join returns only the matching rows from both tables based on the join condition specified. The result set only includes the rows that have matching values in both tables.<br>
   2. Left Outer Join: A Left Outer Join returns all the rows from the left table (the first table in the join clause), and the matching rows from the right table (the second table in the join clause). If there is no match, NULL values will be displayed for the right table's columns.<br>
   3. Right Outer Join: The Right Outer Join is similar to the Left Outer Join, but returns all the rows from the right table and the matching rows from the left table. If there is no match, NULL values will be displayed for the left table's columns.<br>
   4. Full Outer Join: A Full Outer Join returns all the rows from both tables, with matching rows combined, and non-matching rows from either table displayed as NULL values. If there is no match in either table, NULL values will be displayed for all columns from the non-matching table.<br>
4. By default, the first table selected is referred to as t1, and the newly added table for joining as t2. The name of the tables can be customized.<br>
5. After selecting the table to join, the on condition needs to be selected at the bottom. The on condition determines which column to base the joining of the two tables on. For example, the "to address" of the transaction and the "address" of the label table can be matched. In this case, the "to\_address" column from t1 and the "address" column from t2 are selected. If the data in the selected on columns is the same, the information from the two tables is considered connected and merged.

   [![](https://downloads.intercomcdn.com/i/o/687217576/a4cc296d9ec2235c51e018a7/join4.png)](https://downloads.intercomcdn.com/i/o/687217576/a4cc296d9ec2235c51e018a7/join4.png)
6. After joining, columns from both tables can be used in Metric, Where, and Group by sections below.

   [![](https://downloads.intercomcdn.com/i/o/687217548/8d52c4116dc9631f7dd66ddf/join5.png)](https://downloads.intercomcdn.com/i/o/687217548/8d52c4116dc9631f7dd66ddf/join5.png)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://userguide.cryptoquant.com/vi/web3-analytics-tool/how-to-use/5.-query-block-join.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
