Compare two Tables using Left Join

10 Feb


1) All records from  Table 1 that Not Exist in Table 2
SELECT Table1.Codigo, Table2.Codigo
FROM Table1 LEFT JOIN Table2 ON Table1.Codigo = Table2.Codigo
WHERE (((Table1.Linea) Is Null));

2) All records from t Table 2 that not exist in Table 1 (invert columns from prevoius example)

My Example Reference:

FROM f0901_obj as A LEFT JOIN f0902_obj as B ON A.gmAID = B.gbAID
WHERE (((B.gbAID) Is Null)) order by a.gmobj;


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: