The Table from STDIN is the master.
A natural join produces a new rdbtable that contains only rows from the input rdbtables that match on the specified columns (key columns). A master-detail join produces a new rdbtable that contains all rows from the master rdbtable and those rows from the secondary rdbtable that match. A cartesian join produces an rdbtable that contains all rows of both input rdbtables.
Each item in the list of column(s) may specify column names that are different in the two rdbtables, i.e. '=column_2', if given, refers to a name in rdbtable_2 that corresponds to 'column' in rdbtable_1. If '=column_2' is not given it means that the corresponding column name in both rdbtables is the same.
If different column names are specified, the name of the join columns in the output rdbtable will be from rdbtable_1. Note that the two rdbtables must be sorted on the columns specified in order for a join operation to function correctly. The order of columns in the output rdbtable will be: first the join columns, then the other columns from rdbtable_1, then the other columns from rdbtable_2.
This operator reads an rdbtable via STDIN and writes an rdbtable via STDOUT.
If we have the rdbtable (named samplej) here:
and the rdbtable (named samplej2) here:
then the command to do a natural join of samplej and samplej2 on column name is:
and the result is:
The command to do a ``master detail'' join of the same two rdbtables on column name is:
and the result is: