select rank() over (partition by cusnum, prodnum order by MAX(Order_Line.upddate) DESC) as 'RANK', bilcusnum, prodnum, soldby_price from Orders join Order_Line on Orders.ordnum = Order_Line.ordnum group by prodnum, cusnum, soldby_price, Order_Line.upddate;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)