Guest User

Untitled

a guest
Nov 24th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. some_data, p_column, type
  2. pla, 1, a
  3. bla, 1, b
  4. sth, 1, a
  5. sth, 2, a
  6.  
  7. some_data, p_column, type, rank
  8. pla, 1, a, 1
  9. bla, 1, b, 2
  10. sth, 1, a, 3
  11. sth, 2, a, 1
  12.  
  13. some_data, p_column, type, rank
  14. bla, 1, b, 2
  15. sth, 2, a, 1
  16.  
  17. for each partition:
  18. if type b is in partition:
  19. select row b with lowest rank
  20. else:
  21. select row a with lowest rank
Add Comment
Please, Sign In to add comment