-Invoice_Table-
Customer Job_No Sale_Amt
12345678 123456 123.45
87654321 246800 645.23
-Vendor_Table-
Customer Job_No Vendor Vendor_Cost
12345678 123456 ABCDEF 10.50
12345678 123456 UVWXYZ 20.92
87654321 246800 LMNOPQ 12.45
And I have a query similar to the following (but a LOT more complex):
SELECT
Inv.Customer,
Inv.Job_No,
Ven.Vendor,
Ven.Cendor_Cost,
Inv.Sale_Amt
FROM
Invoice_Table Inv
LEFT OUTER JOIN Vendor_Table Ven
ON Inv.Customer = Ven.Customer
AND Inv.Job_No = Ven.Job_No
This query produces output similar to the following:
Customer Job_No Vendor Vendor_Cost Sale_Amt
12345678 123456 ABCDEF 10.50 123.45
12345678 123456 UVWXYZ 20.92 123.45
87654321 246800 LMNOPQ 12.45 645.23
Customer Job_No Vendor Vendor_Cost Sale_Amt
12345678 123456 ABCDEF 10.50 123.45
12345678 123456 UVWXYZ 20.92 0 (or NULL)
87654321 246800 LMNOPQ 12.45 645.23
Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.
”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.
Our community of experts have been thoroughly vetted for their expertise and industry experience.
The Most Valuable Expert award recognizes technology experts who passionately share their knowledge with the community, demonstrate the core values of this platform, and go the extra mile in all aspects of their contributions. This award is based off of nominations by EE users and experts. Multiple MVEs may be awarded each year.