当前位置:网站首页>Examples of unconventional aggregation

Examples of unconventional aggregation

2020-11-06 01:16:06 raqsoft

【 Abstract 】
     Aggregation is the calculation of data , Returns the aggregate result . Aggregation operations are often accompanied by grouping operations , In addition to the usual summation 、 Maximum 、 minimum value 、 Aggregation operations such as counting , And some logic operations and so on . How to deal with the polymerization problem easily and quickly , Here's the whole process , And provide esProc Sample code . Examples of unconventional aggregation problems

1. Aggregate sum after enumeration grouping

【 example 1】 From the city GDP In the table , Separate statistics of municipalities directly under the central government 、 Per capita in first tier and second tier cities GDP. City GDP Some of the data in the table are as follows :

【SPL Script 】

A5 The results are as follows :

2. Merge overlapping time intervals

【 example 2】 Take the customer ANATR Merge order records with recurring time periods . Some data in the customer table are as follows :

【SPL Script 】

A4 The results are as follows :

3. Count the number of satisfied conditions in group aggregation

【 example 4】 Ask for the number of students who failed in each subject in a class . Some of the data in the report form are as follows :

【SPL Script 】

A3 The results are as follows :

4. In a set of Boolean values , Aggregation performs logic and operations

【 example 5】 According to a series of primary school online teaching terminal Questionnaire , See if all students have access to mobile phones . The questionnaire and summary contents of each class are as follows :

【SPL Script 】

A4 The results are as follows :

5. In a set of Boolean values , To perform logic or operations in aggregation

【 example 6】 Check with customers RATTC, stay 2014 Whether it has been ranked in the top three of monthly sales . The data in the sales table are as follows :

【SPL Script 】

A7 The results are as follows :

SPL CookBook》 There are more examples of relevant calculations in .

版权声明
本文为[raqsoft]所创,转载请带上原文链接,感谢