get best streak with all details of each row

Posted by Pritesh Gupta on Stack Overflow See other posts from Stack Overflow or by Pritesh Gupta
Published on 2012-10-08T15:28:47Z Indexed on 2012/10/08 15:37 UTC
Read the original article Hit count: 220

Filed under:
ID           user_id         win  
1              1               1  
2              1               1  
3              1               0  
4              1               1  
5              2               1  
6              2               0  
7              2               0  
8              2               1  
9              1               0  
10             1               1  
11             1               1  
12             1               1  
13             1               1 
14             3               1  

I needs to get the complete row for the best streak. I am able to get best streak no. for each user using this post.

get consecutive records in mysql

Now, I needs to get each rows data for that are involved in the best streak. i.e. for user=1, I need the complete row data for id=10,11,12,13. i.e. user_id,win and id value for these best streak row using mysql. Kindly help me on this.

© Stack Overflow or respective owner

Related posts about mysql