5. Query Block - Join


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.

  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.

    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.

    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.

    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.

    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.

  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.

  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.

  6. After joining, columns from both tables can be used in Metric, Where, and Group by sections below.

Last updated