You are here: Commands > Join > Join Versus Relations

Join Versus Relations

Join and Relations both allow you to work with data from more than one table. Join provides several include/exclude options that are not available through Relations. However, certain kinds of analyses are more easily performed with Relations. Depending on the type of analysis required, one command may be more efficient than the other.

Join allows you to combine data from two tables, with output going to a third table. The output can consist of matched or unmatched data, depending on the type of Join you specify.

Relations allows you to create virtual joins between tables. Data from separate but related tables can be analyzed as though it existed in a single table.

In both cases, you need a key field common to the two tables to be joined or related.

Join uses more disk space than Relations for three reasons:

For a Join, you must sort the secondary table and preferably sort or index the primary table also. However, to relate two tables, you need to index only one table. Sorting creates a new table as large as the original one. Indexing creates a small index file that points to the original table.
Join creates a new table that can be larger than both the primary and secondary tables together, depending on the type of Join performed. Relations does not write a new table. If you need a table that contains the related data, you can create one by extracting the related fields using the Extract command.
To join four tables, you need to perform three sorts and three joins. To relate four tables, you need the original table and three indexes on the other tables.

For more information, see Relations.