Guest User

Untitled

a guest
Nov 17th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. select ip,
  2. sum(case when score <> (select t2.score from score t2
  3. where t2.timestamp = (select max(timestamp) from score
  4. where ip = t2.ip
  5. and timestamp < t1.timestamp)
  6. and t1.ip = t2.ip) then 1 else 0 end)
  7. from score t1
  8. group by ip;
  9.  
  10. select ip, sum(case when score <> s.score) ..
  11. from (select t2.score ..) s
Add Comment
Please, Sign In to add comment