Home > database >  How to create a stored procedure for a number of columns in the continuous increasing sequence lengt
How to create a stored procedure for a number of columns in the continuous increasing sequence lengt

Time:10-02

Such as in table number:
ID num
1 10
2 12
3, 11
4 12
May 13
June 14
7 12
8 and 9
Lookup table in the continuous increasing num is the line and the length is more than 3 sequence like (10, 12) is the sequence of length 2

CodePudding user response:

Write in the stored procedure: ()

CodePudding user response:

In accordance with the order ID, the next record - on the value of a record & gt;=3?

CodePudding user response:

 select * from (
Select a. *, (select b.i d from number b where b.i d> Anderson, d order by b.i d limit 1) as id2
The from number a
Aa, number bb)
Where aa. Id2=bb. Id and bb, num - aa. Num>=3
  • Related