


JOIN(1)             UNIX Programmer's Manual		  JOIN(1)



NAME
     join - relational database operator

SYNOPSIS
     join [ options ] file1 file2

DESCRIPTION
     _J_o_i_n forms, on the standard output, a join of the two rela-
     tions specified by the lines of _f_i_l_e_1 and _f_i_l_e_2.  If _f_i_l_e_1
     is `-', the standard input is used.

     _F_i_l_e_1 and _f_i_l_e_2 must be sorted in increasing ASCII collating
     sequence on the fields on which they are to be joined, nor-
     mally the first in each line.

     There is one line in the output for each pair of lines in
     _f_i_l_e_1 and _f_i_l_e_2 that have identical join fields.  The output
     line normally consists of the common field, then the rest of
     the line from _f_i_l_e_1, then the rest of the line from _f_i_l_e_2.

     Fields are normally separated by blank, tab or newline.  In
     this case, multiple separators count as one, and leading
     separators are discarded.

     These options are recognized:

     -a_n  In addition to the normal output, produce a line for
	  each unpairable line in file _n, where _n is 1 or 2.

     -e _s Replace empty output fields by string _s.

     -j_n _m
	  Join on the _mth field of file _n.  If _n is missing, use
	  the _mth field in each file.

     -o _l_i_s_t
	  Each output line comprises the fields specified in
	  _l_i_s_t, each element of which has the form _n._m, where _n
	  is a file number and _m is a field number.

     -t_c  Use character _c as a separator (tab character).  Every
	  appearance of _c in a line is significant.

SEE ALSO
     sort(1), comm(1), awk(1)

BUGS
     With default field separation, the collating sequence is
     that of _s_o_r_t -_b; with -t, the sequence is that of a plain
     sort.





Printed 11/26/99	 April 29, 1985                         1






JOIN(1)             UNIX Programmer's Manual		  JOIN(1)



     The conventions of _j_o_i_n, _s_o_r_t, _c_o_m_m, _u_n_i_q, _l_o_o_k and _a_w_k(1)
     are wildly incongruous.





















































Printed 11/26/99	 April 29, 1985                         2



