SQL Script: All Payments By Supplier with Largest Pay Site Pulled In
Not sure if this is the correct community. Assistance needed with the SQL script below, mostly with a subquery using DENSE_RANK() OVER (PARTITION BY.
I have a need in Payables R12.2 to query total (non-voided) Payment amounts by Supplier within an operating unit . . . but pull in the address from the pay site with the largest payment amount for that supplier in that OU. If the supplier has multiple sites whose payment totals for the period tied for # 1 for that supplier, then I want just one of the top sites pulled in -- I actually don't care which top site.