b1234 aa2 c1234 aa3 d1234 aa3 ! % cat test2.txt 1 a1234 bb1 2 a1234 bb2 3 b1234 cc1 4 c1234 dd3 5 e1234 NULL ! % q "select * from test1.txt as a left join test2.txt as b on a.c1 = b.c2" a1234 aa1 1 a1234 bb1 a1234 aa1 2 a1234 bb2 b1234 aa2 3 b1234 cc1 c1234 aa3 4 c1234 dd3 d1234 aa3