Home > database >  How to be carried out in accordance with the fixed number of date statistics, SQL
How to be carried out in accordance with the fixed number of date statistics, SQL

Time:09-26

The database structure is as follows:
Date score
20180101
15 20180102
20180103
20180104 16
20180105
11 20180107
33 20180108
20180109 2
13 20180110
20180112
26 20180114
20180116
20180117
23 20180119
20180120, 75,
20180123 2
20180128
For every 5 record (row a sequence of) since the packet statistics and maximum minimum, start and end values, tail number less than five (5) according to the remaining how much calculate how much, the results are as follows:
Starting date maximum minimum start end
20180101 16 3 3 9
20180107 33 2 November 4
26, 20180114, 75 3 75
20180123 4 2 2 4

A little complicated, please read master patience, thank you very much,

CodePudding user response:

Use access return true have never thought a good way to, can only add one column, which is used to group 5 record

Other database query can increase the serial number, serial number, divided by 5

CodePudding user response:

Grouping is not here, as you this format can not group, said the LS add column of this can be considered, with the grouping columns will be a little bit more convenient, need you increase in record time to add the column of the assignment,
But it's not science, because you are a dynamic database design requirements to lia,
So I suggest you select * first check out all, after local in datatable to handle then, inside the datatable support SQL writing, also is simpler,
It is ok to dt. The select (),