Computer Science
The following script uses a derived table to return he date and invoice total of the earliest invoice issued by each vendor. Write a script that generates the same results set but uses a temporary table in place of the derived table. Make sure your script tests for the existence of any objects it creates.
Use itse2333; SELECT VendorName, FirstInvoiceDate, InvoiceTotal FROM Invoices JOIN (SELECT VendorID, MIN(InvoiceDate) as FirstInvoiceDate FROM invoices GROUP BY VendorID) as FirstInvoices ON (Invoices.VendorID = FirstInvoice.FirstInvoice.VendorID and Invoices.InvoiceDate = First.Invoice.FirstInvoiceDate) JOIN Vendors ON Invoices.VendorID = Vendor.VendorID ORDER BY VendorName, FirstInvoiceDate);
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here