Home > database >  MYSQL find out in the first 10 records, how to combine the rest of the data for the other.
MYSQL find out in the first 10 records, how to combine the rest of the data for the other.

Time:09-28

The SELECT SKT1. SKF6 SKT1. SKF7, SUM (SKT1. SKF128) AS mny, SUM (SKT1. SKF128)/(SELECT SUM (SKT1. SKF128)
The FROM SKT1 the WHERE SKT1. SKF136=1 AND SKT1. SKF4 & gt;='2018-03 AND SKT1. SKF4 & lt;='2018-03),
The FROM SKT1 the WHERE SKT1. SKF4 & gt;='2018-03 AND SKT1. SKF4 & lt;='2018-03 AND SKT1. SKF136=1
GROUP BY SKT1. SKF6
The ORDER BY MNY DESC
LIMIT of 5
More than a total of 120 data, how can I put the first five found out after the rest of the merged into a column, called 'other' first two merger, mny and the back of the percentage of the remaining data

CodePudding user response:

The union again all about another SQL limit 5100 00
  • Related