Development tools : Global functions : List and Table category : tableJoin
  
tableJoin
Description
Joins matching rows from two tables and adds the joined rows into destination table.
Usage
Client side: N
Server side: Y
Syntax
IndexedCollection tableJoin(source1, source1Column, source2, source2Column, joinType)
Argument
source1
The first table to be joined. The type is IndexedCollection.
source1Column
Name of the column in the first table that is used for column value matching. You can specify multiple columns and separate them by using commas. The type is String.
source2
The second table to be joined. The type is IndexedCollection.
source2Column
Name of the column in the second table that is used for column value matching. You can specify multiple columns and separate them by using commas. The type is String.
joinType
Indicates the type of the join operation. Supported values are Inner, Left, and Right:
Inner: Only matching rows are added to the destination table and unmatched rows are discarded.
Left: Matched rows are added, and unmatched rows of src1 table are also added to the destination table.
Right: Matched rows are added, and unmatched rows of src2 table are also added to the destination table.
Return
Returns the table with joined rows.
The rows match when the cell value of source1Column is equal to the cell value of source2Column.
If source1 table and source2 table have columns with same names, the values in source1 table are used.
Where there are more than one cells that have the same value in source1Column and source2Column, each cell value in source1Column is matched once with each cell value in source2Column. Therefore, the number of rows added in the returned table equals to the number of cells with the same value in source1Column multiply by the number of cells with the same value in source2Column.
For example, if there are 2 cells with value a in source1aColumn and 3 cells with value a in source2aColumn, 6 joined rows are added to the returned table.
You can involve multiple columns for matching conditions, for example source1aColumn and source1bColumn in source1 table, and source2aColumn and source2bColumn in source2 table. For each item i in source1 and each item j in source2, specify source1aColumn,source1bColumn for source1Column and source2aColumn,source2bColumn for source2Column to join rows that meet the following conditions:
source1.i.source1aColumn == source2.j.source2aColumn
and
source1.i.source1bColumn == source2.j.source2bColumn
Note Matching conditions are evaluated according to the sequence of the columns that you specify for source1Column and source2Column.
See
See also
Go up to
List and Table category