Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select ip,
- sum(case when score <> (select t2.score from score t2
- where t2.timestamp = (select max(timestamp) from score
- where ip = t2.ip
- and timestamp < t1.timestamp)
- and t1.ip = t2.ip) then 1 else 0 end)
- from score t1
- group by ip;
- select ip, sum(case when score <> s.score) ..
- from (select t2.score ..) s
Add Comment
Please, Sign In to add comment