On Fri, 2008-08-22 at 17:10 -0400, Emi Lu wrote: > > Would you please give me an example? > > I have two tables like the following: > T1 (col1 varchar, col2 varchar, primary key (col1, col2)) > T2 (col1 varchar, col2 varchar, primary key (col1, col2)) > > > Query I have is: > =================== > select col1, col2 > from T1 > left join T2 using (T1, T2); > > Thanks a lot!
If (T1.col1, T1.col2) != (T2.col1, T2.col2) then the join is unsuccessful and T2.col1 and T2.col2 will be null. If you're wondreing if the join was successful: select col1, col2 from T1 left outer join T2 using (col1, col2) where T2.col1 is not null -Mark -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql