Discover the best answers to your questions with the help of IDNLearn.com. Get the information you need from our community of experts who provide accurate and thorough answers to all your questions.

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