Answer:
Create table vendor(vendor_id int,due_invoice int,invoiceTotal int);
Create view v as select vendor_id,max(due_invoice) as unpaid from vendor;
Select sum(unpaid) from v;
Select vendor_id,invoiceTotal from vendor group by vendor_id;
1.6m questions
2.0m answers