Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select tt.id, abs(t1.len-t2.len) df
- from
- (select id, min(Num_challenge) min_nc, max(Num_challenge) max_nc
- from t group by id) tt
- join t t1 on t1.id=tt.id and t1.Num_challenge=tt.min_nc
- join t t2 on t2.id=tt.id and t2.Num_challenge=tt.max_nc
- order by df desc
- limit 3
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement