ColumnwiseCombine[{tab1,…}ckey]
combines Tabular objects tab1,… by joining all combinations of rows where the values of the columns with key ckey from each of the tabi are the same.
ColumnwiseCombine[{tab1,…}{ckey1,ckey2,…}]
combines rows where the values of all of the columns having keys ckeyj have the same values.
ColumnwiseCombine[{tab1ckey1,tab2ckey2,…}]
joins rows with common values in columns with key ckeyi in tabi.
ColumnwiseCombine[<|p1tab1,p2tab2,…|>]
prefixes column key ckeyij in tabi in the result using ExtendedKey[pi,ckeyij].
ColumnwiseCombine[<|p1tab1,p2tab2,…|>tfun]
includes joined rows for all combinations of rows where tfun[<|p1tab1[j1], p2tab2[j2], …|>] is True for all 1≤j1≤Length[tab1], 1≤j2≤Length[tab2], ….
ColumnwiseCombine[tabs,required]
includes all rows in the Tabular objects specified by required by combining with rows of all missing elements from the other Tabular objects if needed.


ColumnwiseCombine
ColumnwiseCombine[{tab1,…}ckey]
combines Tabular objects tab1,… by joining all combinations of rows where the values of the columns with key ckey from each of the tabi are the same.
ColumnwiseCombine[{tab1,…}{ckey1,ckey2,…}]
combines rows where the values of all of the columns having keys ckeyj have the same values.
ColumnwiseCombine[{tab1ckey1,tab2ckey2,…}]
joins rows with common values in columns with key ckeyi in tabi.
ColumnwiseCombine[<|p1tab1,p2tab2,…|>]
prefixes column key ckeyij in tabi in the result using ExtendedKey[pi,ckeyij].
ColumnwiseCombine[<|p1tab1,p2tab2,…|>tfun]
includes joined rows for all combinations of rows where tfun[<|p1tab1[j1], p2tab2[j2], …|>] is True for all 1≤j1≤Length[tab1], 1≤j2≤Length[tab2], ….
ColumnwiseCombine[tabs,required]
includes all rows in the Tabular objects specified by required by combining with rows of all missing elements from the other Tabular objects if needed.
Details

- ColumnwiseCombine is typically used to combine several Tabular objects into a single one.
- With two Tabular objects tab1 and tab2, ColumnwiseCombine is effectively SQL JOIN.
- The specification required for requiring rows from the {tab1,…,tabn} includes:
-
{} or "Inner" only include rows with matches Range[n] or "Outer" include all rows from all the tabulars 1 or "Left" include all rows from the first tabular n or "Right" include all rows from the last tabular {i1,i2,…} include all rows from tabii,tabi2,… {pi1,pi2,…} use the prefixes to identify the tabulars - ColumnwiseCombine[p1tab1,p2tab2,…|>(True&)] yields a cross join.
Examples
open all close allBasic Examples (4)
Combine rows where the values in column "a" are the same:
Combine three Tabular objects from rows that match in columns "a" and "b":
Include all the rows of tab1, tab2 and tab3:
Combine three Tabular objects from rows that match in column "a" using prefixes to avoid collision in column "b":
Give the result without the column "a" merged:
Include any combinations of rows that have matches in column "c" from tab1 and column "b" from tab3:
Scope (17)
Matching Keys (2)
Give rows where the all of the values in columns "a" and "b" are the same:
The order the keys are specified is used in the result but does not affect which rows match:
Give all row combinations where the all of the values in columns "a" and "b" in tab1 and "A" and "B" in tab2 are the same:
There are no combinations of rows that have values matching in both "a" and "B" and "b" and "A":
There is a single row combination that matches in column "a" from tab1 and "A" and "B" from tab2:
Required Rows (8)
Include only rows where values in both columns "a" and "b" match:
This is the default and also equivalent to not requiring all rows from either tab1 or tab2:
Include an instance of all rows from both tab1 and tab2. Where there is not a match, values are filled in as missing:
Using {1,2} for the specification is equivalent:
With the specification {2,1}, the unmatched rows from tab2 are included before those of tab1:
Include an instance of all rows from tab1:
Using "Left" for the specification is equivalent since tab1 is the leftmost in the list:
Include an instance of all rows from tab2:
Using "Right" for the specification is equivalent since tab1 is the leftmost in the list:
Include only combinations of rows from three Tabular objects where the values of column "a" match:
This is the default and also equivalent to specifying no row requirement:
Include an instance of all rows from three Tabular objects:
Using {1,2,3} for the specification is equivalent:
Show the result of all possible specifications for the required rows for three Tabular objects:
When there are no matches, using "Outer" effectively stacks the Tabular objects:
This is equivalent to using Join:
Key Prefixes and Collisions (2)
Find combinations of rows where column "a" matches:
Using the key prefixes given with Association is necessary because there is a collision with column "b" where the values do not match:

When the match column names are given with specific Tabular objects, the matched columns are included with the prefixed names:
Include all the rows from two Tabular objects, merging row combinations where the values of column "b" match:
A mix of columns to match and merge and just to match may be used:
When the match column names are given with specific Tabular objects, the matched columns are included with the prefixed names and have missing elements where there is not a match:
Match Test Functions (5)
Do a cross join (where any combination of rows is considered a match and included) of three Tabular objects:
In this case, the specification for required rows makes no difference, since all rows are included anyway:
Specify that the values from column "a" of tab1 or column "c" of tab2 are the same:
This is equivalent to using column names:
The function gets a single argument for each possible combination of rows; for row i from tab1 and row j from tab2, the argument is a list of Association objects, {Normal[tab1[i]],Normal[tab2[j]]}:
With Apply, the function gets two arguments and positional parameters may be used:
When the first argument is given as an association, the function gets an Association argument:
Find the combinations of rows where values in column "a" is the same and values in column "b" have the same length:
Find the combinations of rows where the parity of the values in column "a" is the opposite of the values in column "b":
Include any combinations of rows that have matches in column "a" from tab1 and tab2, "c" from tab1 and column "b" from tab3:
Applications (2)
Compare data from an imported table of country data with Wolfram "Country" entity data:
Get the cases where the country names are inconsistent:
Show just the names and country codes:
Combine the two tables by matching country code:
Add an extra column showing the survival rate by sex and class in a subset of the Titanic dataset:
Properties & Relations (4)
When there are no matches, using "Outer" effectively joins the Tabular objects:
This is equivalent to using Join:
With only two Tabular objects and no column collisions, ColumnwiseCombine and JoinAcross do the same operation:
When there is a key collision, JoinAcross uses a key collision function (default left):
With ColumnwiseCombine, key collisions are not allowed without key prefixes:

Compare ternary ColumnwiseCombine with nested JoinAcross:
Define a function to successively combine pairs:
When the column names are consistent and no extra rows are required, this is consistent with ColumnwiseCombine:
However, when extra rows are required, the results may be different:
ColumnwiseCombine is effectively an outer product of rows:
Use Outer to find which combinations of rows give True:
These are the row combinations that match:
Make a Tabular object with merged columns:
Use ExtendedKey to form the same result as ColumnwiseCombine:
See Also
Related Guides
History
Text
Wolfram Research (2025), ColumnwiseCombine, Wolfram Language function, https://reference.wolfram.com/language/ref/ColumnwiseCombine.html.
CMS
Wolfram Language. 2025. "ColumnwiseCombine." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ColumnwiseCombine.html.
APA
Wolfram Language. (2025). ColumnwiseCombine. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ColumnwiseCombine.html
BibTeX
@misc{reference.wolfram_2025_columnwisecombine, author="Wolfram Research", title="{ColumnwiseCombine}", year="2025", howpublished="\url{https://reference.wolfram.com/language/ref/ColumnwiseCombine.html}", note=[Accessed: 04-August-2025]}
BibLaTeX
@online{reference.wolfram_2025_columnwisecombine, organization={Wolfram Research}, title={ColumnwiseCombine}, year={2025}, url={https://reference.wolfram.com/language/ref/ColumnwiseCombine.html}, note=[Accessed: 04-August-2025]}