STScI Logo

tproduct tables


NAME · USAGE · DESCRIPTION · PARAMETERS · EXAMPLES · BUGS · REFERENCES
SEE_ALSO

NAME

tproduct -- Form the Cartesian product of two tables.

USAGE

tproduct intable1 intable2 outtable

DESCRIPTION

This task creates an output table which is the Cartesian product of two input tables. This Cartesian product consists of every possible combination of the rows of the two input tables. Therefore, the number of rows in the output table is the product of the number of rows in the two input tables. The output table will contain all the columns from both input tables. If a column name in the first input table is the same as a column name in the second input table, this task tries to create a unique name by appending "_1" to the first name and "_2" to the second name. If the task cannot create a unique name in this way, it stops with an error.

PARAMETERS

intable[file name]
First input table.
intable[file name]
Second input table.
outtable [file name]
Output table containing the possible Cartesian products.

EXAMPLES

1. Find all persons sharing a phone from a phone list:

tt> tproduct phone.tab phone.tab phone.tmp
tt> tselect phone.tmp share.tmp "phone_1 == phone_2 && name_1 < name_2"
tt> tproject share.tmp share.tab phone_2 inc-
tt> delete *.tmp

BUGS

REFERENCES

This task was written by Bernie Simon.

SEE ALSO

tselect, tproject, tjoin


Source Code · Search Form · STSDAS