A JOIN clause combines columns from one or more tables into a new table. Depending on a JOIN type, you can get different results for the same joined tables.
dbForge Query Builder for SQL Server allows you to visually create 5 kinds of JOINs: INNER, LEFT OUTER, RIGHT OUTER, FULL OUTER, and CROSS JOINs. In the Joins tab of the Tabbed Editor, you can create new JOINs between tables, remove existing JOINs, select a type of JOINs, group JOINs, and add conditions to the JOIN clause.
The guide covers how to:
To add a JOIN between two tables, do either of these:
Note
JOINs are automatically added when a table with a foreign key and its referenced table are dragged onto the diagram.
To create a JOIN using the Tabbed Editor
1. On the Joins tab, click Add a new join with condition.
2. In a new JOIN syntax construction that opens, do the following:
3. The JOIN clause is added and the logical relationship between tables is displayed on the diagram.
4. When switching to the Text view, you can preview the SELECT statement.
The Tabbed Editor shows the JOIN clause as a tree with the JOIN type, condition, and condition groups. A group consists of several conditions or subgroups, combined with a logical operator.
To navigate between conditions and groups, use the UP ARROW and DOWN ARROW keys. Use the LEFT ARROW and RIGHT ARROW keys to navigate between a criteria operator and operands.
To add a new group, click the upper-level group operator or JOIN type and select Add Group.
To add a new condition
1. On the Joins tab, open the condition construction by using one of the following ways:
2. Click enter column name and select a column.
3. Click the condition criteria operator and select the logical operator you want to apply.
4. If the condition operator requires operand values, specify them.
To remove a condition, click Delete or navigate to the condition and press the DELETE or MINUS SIGN keys.
To remove a group, do one of the following:
You can remove a JOIN in one of the following ways:
To remove a JOIN on the diagram, right-click the selected connector and select Remove from Diagram.
To edit JOINs, do one of the following:
You also can copy, cut, and paste conditions and groups with the CTRL+C, CTRL+X, and CTRL+V keys.