Joining Tables

Joins are SQL statements that correlate data between tables without repeating the data in every table. For example, joining two tables, customers and orders, by a customer number column combines the records for customers and orders and returns those records where the customer numbers are equal.

You can join multiple tables by selecting columns that are common to both tables. Use the Query Builder - Join Tables page to join tables.

SQR Production Reporting Studio automatically joins table columns for which both the name and the data type are the same. You can add, remove, or modify joins as desired.

*  To add a table join, use the mouse to drag columns from one table to another. Join columns that have equal data types.

For example, join a text column to another text column. You cannot create joins between columns with unequal data types. For example, you cannot create joins between text columns and number columns.

    *  To remove a table join, click the arrow representing the join and press the [Delete] key. You can also remove joins by clicking the Join button and deleting the joins in the Joins dialog box. To remove all the joins, click Remove All.

      Note:

      Use joins with care since unnecessary joins make retrieval time longer and may cause the return of inappropriate data. The Auto-Join feature may add extra joins that you do not need.

      FieldDescription

      Join

      Displays the joins between the selected tables.

      Remove All

      Removes the existing joins between the selected tables.

      Arrange

      Aligns the display of selected tables.

      Auto-Join

      Joins table columns for which both the name and data type are the same.

      SQL Tip: Table joins become part of the WHERE clause.

      Related Topics

      Setting the Join Type

      Joining a Table to Itself