Trying to get highest 20 rows of the below query based on “Net Amount in USD” column which is a sum column. Any clues?
select
INVOICE.IDENTITY as "Identity",
supplier.vendor_name,
to_char(sum(INVOICE.ACTUAL_NET_DOM_AMOUNT), '$999,999,999') as "Net Amount in USD"
from &AO.INVOICE
inner join
&AO.supplier
on &AO.Invoice.identity = &AO.supplier.vendor_no
where INVOICE.OBJSTATE <> 'Cancelled'
group by
INVOICE.IDENTITY,vendor_name