SQL data wash

hi guys,

quite a simple one, I just need to brush up on a little SQL.

Essentially I have two tables in SQL, one called expired_ml and the other one called expired_old.
All I want to do is create a view that has all of the expired_Ml without any of the fields that are the same in expired_old.  This is what I currently have:

SELECT     dbo.ML_Expired_db.*
FROM         dbo.[expired old] INNER JOIN
                      dbo.ML_Expired_db ON dbo.[expired old].Company = dbo.ML_Expired_db.Company

which obviously picks  up the common ones, I want the uncommon ones from ML-Expired_db

thank you for your help!!
maverickauAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Anthony PerkinsConnect With a Mentor Commented:
Something like this:
SELECT  e.*
FROM    dbo.ML_Expired_db e
        LEFT JOIN dbo.[expired old] o ON e.Company = o.Company
WHERE   o.Company IS NULL

Open in new window

0
 
maverickauAuthor Commented:
perfect!!! thank you.  been a couple of years since I have had to play in SQL much!  you are a legend!
0
 
maverickauAuthor Commented:
thank you!  so quick to respond as well!
0
All Courses

From novice to tech pro — start learning today.