Write a query pulling the latest InvoiceDueDate and VendorID

Write a query pulling the latest InvoiceDueDate and VendorID from invoices. If you add InvoiceNumber to the query , you might not get the unique last InvoiceDueDate associated with a VendorID. Explain why.

Solution

select VendorID,max(InvoiceDueDate) from Invoices group by VendorID;

Vendor might have more than one invoice...
Vendor might have invoices that he has already paid Ex;- InvoiceStatus=\"PAID\" we should not consider
all the invoices we should only take the latest one...

Write a query pulling the latest InvoiceDueDate and VendorID from invoices. If you add InvoiceNumber to the query , you might not get the unique last InvoiceDue

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site