Welcome to Westonci.ca, where you can find answers to all your questions from a community of experienced professionals. Experience the ease of finding accurate answers to your questions from a knowledgeable community of professionals. Our platform offers a seamless experience for finding reliable answers from a network of knowledgeable professionals.

with top5 as (select top 5 vendorid, avg(invoicetotal) as avginvoice from invoices group by vendorid order by avginvoice desc) select invoices.vendorid, max(invoices.invoicetotal) as largestinvoice from invoices join top5 on invoices.vendorid