Add Tables
In order for your query to return results you must add to it at least one table. Sometimes you may have to add multiple tables to capture all the data for a given request. In this case you will need to join tables together.
The tables you use (and need), and how they should be joined is determined by the database design, and how files in the database relate to each other. This information can be learned over time, or provided by someone in your organization.
The process below to add tables is the same for new queries, and for modifying existing queries (once opened in the editor). To remove tables, or modify the join see the topics, Add or Remove Tables, and Modify or Delete the Join.
Steps
-
Once in the Query Editor (see Create a New Query for information) press the Add Tables button .
The Add Table panel opens on the right.
- Use the drop-down list to select, or type the name of a table if you know it, and the list will filter so you can quickly add.
-
Click to select a table like so:
-
Press the Save button to add the table to the editor.
The query editor displays the selected table(s) in the top section, and all the columns in the table like so:
- To add additional tables, repeat the process starting at step 1.
Join Tables
Selecting more than one table for your query opens the Modify Join panel on the right.
Steps
-
Choose one of the four join options.
The different types will produce the following results:
Left Join - Return all rows from the left table plus any matched rows in the right table.
Right Join - Return all rows from the right table plus any matched rows in the left table.
Inner Join - Return only matched rows between both tables.
Full Join - Return all rows from each file plus any matched rows.
- In the ‘ON’ section, use the drop-down for each table pair to select the column(s) to join the tables on. You can type partial column names to search.
-
Press the Save button .
The query editor displays the two tables with the join like so:
Repeat this process for each file you wish to add.