Join Syntax help

I'm trying to modify some queries to use ANSI SQL.  I'm practicing in Northwind to start.  I have query A which returns all customers showing USA as the country where appropriate.  How do I change query B to match the output of query A?

--QUERY A
SELECT
      A.CustomerID,
      A.CompanyName,
      B.OrderID,
      B.ShipCountry
FROM
      Customers A,
      Orders B
WHERE
      A.CustomerID *= B.CustomerID
      AND B.ShipCountry = 'USA'

--QUERY B
SELECT
      A.CustomerID,
      A.CompanyName,
      B.OrderID,
      B.ShipCountry
FROM
      Customers A LEFT OUTER JOIN Orders B
      ON A.CustomerID = B.CustomerID
WHERE
      B.ShipCountry = 'USA'
LVL 13
TommyTupaAsked:
Who is Participating?
 
Anthony PerkinsConnect With a Mentor Commented:
SELECT     A.CustomerID,
     A.CompanyName,
     B.OrderID,
     B.ShipCountry
FROM     Customers A
     LEFT JOIN Orders B ON A.CustomerID = B.CustomerID And B.ShipCountry = 'USA' AND B.OrderDate > '1998-01-01'
ORDER BY A.CustomerID
0
 
TommyTupaAuthor Commented:
Sorry let me change QUERY A to this:
SELECT
      A.CustomerID,
      A.CompanyName,
      B.OrderID,
      B.ShipCountry
FROM
      Customers A,
      Orders B
WHERE
      A.CustomerID *= B.CustomerID
      AND B.ShipCountry = 'USA'
      AND B.OrderDate > '01/01/1998'
Order By
      A.CustomerID
0
 
Anthony PerkinsCommented:
SELECT      A.CustomerID,
      A.CompanyName,
      B.OrderID,
      B.ShipCountry
FROM      Customers A
      LEFT JOIN Orders B ON A.CustomerID = B.CustomerID And B.ShipCountry = 'USA'
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.