LISTING 4: Final Solution to the New Customers Problem SELECT VY.ym, COUNT(*) - COUNT(VN.customerid) AS existing, COUNT(VN.customerid) AS new, COUNT(*) AS total FROM Vymcusts AS VY LEFT OUTER JOIN Vnewcusts AS VN ON VY.ym = VN.min_ym AND VY.customerid = VN.customerid GROUP BY VY.ym ORDER BY VY.ym