I have a table for which I want to select top the 5 rows by some column A. I also want to have a 6th row titled ‘Other’ which sums the values in column A for all but the top 5 rows.
Is there an easy way to do this? I’m starting with:
select top 5 columnB, columnA from someTable t order by columnA desc
Not tested, but try something like this: