Home > database >  SQL for addition of cumulative occurrences
SQL for addition of cumulative occurrences

Time:09-17

Addition of SQL and the cumulative occurrences,

Thank you,,

Table 1
Id data
1 azaaazaazaazzzzzaazzzzazaaazaa
2 zaaazzzzaazaazzzzzaazzzzazaz
.
Put a watch to 1 to 1 z start cumulative together, have been combined to equal to zero, and then to start over, and equal to zero during the maximum number, the number of occurrences of the

For example above
1 azaaazaazaazzzzzaazzzzazaaazaa

A 1 1 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
shopZ - 1 0 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - is equal to zero, equal to zero in front of the top number is 1
A 1 1
A 1 2
A 1 3
2 z - 1
A 1 3
A 1 4
3 z - 1
A 1 4
A 1 5 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
shop4 z - 1
3 z - 1
2 z - 1
Z - 1 1
Z - 1 0 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - is equal to zero between the maximum number 5
A 1 1
A 1 2
Z - 1 1
Z - 1 0 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- is zero between the maximum number 2
Z - 1-1
Z - 1-2
A 1-1
Z - 1-2
A 1-1
A 1 0 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- is equal to the maximum number between 0-2
A 1 1
Z - 1 0 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- is zero between the maximum number 1
A 1 1
A 1 2 -- -- -- -- -- -- -- -- -- data tail is not equal to 0. Maximum number, no statistical


Have the results

Id 0 is 1 are 2 is 3 to 4 is 5,,,,,,,, negative 1. Negative 2
1. 5 times 2 times 1 0 0 time 1 times,,,,,,,, zero 1
2...


Thank you,,,,,,,,

CodePudding user response:

In what form?

CodePudding user response:

Is obtained after equal to zero, the larger the number of occurrences of ah,

1 azaaazaazaazzzzzaazzzzazaaazaa
2.,,

This data is zero is a total of five times, maximum number is 1 of 2 times is 2 is 1, 5, 2 a,


Id number is equal to zero is the biggest one is biggest is 2 is biggest is 3 is biggest is biggest is 5. 4,,,,,, negative minimum is - 2
5 1 0 0 1 2 1
2.,,,
  • Related