List:General Discussion« Previous MessageNext Message »
From:Barry Date:April 25 2006 10:01am
Subject:Re: Top N selections + rest row
View as plain text  
C.R.Vegelin wrote:
> Hi All,
> 
> Anybody with smart ideas to get Top-N rows plus the rest row ?
> Suppose I have ranked sales values descending for 2005, like:
> Select Country, Sum(Sales) AS Sales From myTable
> Where Year=2005 Group By Country 
> Order By Sales DESC LIMIT 25;
> 
> Then I get Top-25 sales rows, but I also want a rest row,
> where all 26 rows represent the world total.
> I'm using MySQL 5.0.15.
> 
> Regards, Cor
> 
Writing it into a cache_table.
Write the first rows into the cache_table and then the rest of it.
-- 
Smileys rule (cX.x)C --o(^_^o)
Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o)
Thread
Top N selections + rest rowC.R.Vegelin25 Apr
  • Re: Top N selections + rest rowBarry25 Apr
  • Re: Top N selections + rest rowMartijn Tonies25 Apr
  • Re: Top N selections + rest rowC.R.Vegelin25 Apr
    • Re: Top N selections + rest rowShawn Green25 Apr
      • Re: Top N selections + rest rowMartijn Tonies25 Apr
      • Re: Top N selections + rest rowJoerg Bruehe25 Apr
      • Re: Top N selections + rest rowC.R.Vegelin25 Apr
      • Re: Top N selections + rest rowC.R.Vegelin25 Apr
        • Re: Top N selections + rest rowJoerg Bruehe25 Apr