Home > Back-end >  How to implement a set of data summary of terms?
How to implement a set of data summary of terms?

Time:10-03

how to implement such a summary
Please the boss
Use a temporary table

CodePudding user response:

Mainly conditions, 1 to 8 is different condition, with normal SQL statement GROUP BY the command can't meet the requirements, whether to loop data sets, using a temporary table,

CodePudding user response:

Such as the SELECT SUM (index 1),,, SUM index (8) the WHERE condition 1
SELECT SUM (index 1),,, SUM index (8) the WHERE condition 2

CodePudding user response:

Or use FOR I=0 TO collect the unit number
Use A1=index 1 + A1 such
A1=index 1 + 1 A1 the WHERE condition


CodePudding user response:

Select count or sum (CASE 1 THEN return to the WHEN condition field (1) the END) AS statistics and 1
Count or sum (CASE 2 the WHEN condition THEN to return to the field END) AS statistical 2
.
From the table where conditions,

CodePudding user response:

Above, under the Oracel through other database didn't try!
  • Related