Guest User

Untitled

a guest
Jan 20th, 2019
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. select t.*
  2. from (select t.*,
  3. row_number() over (partition by department order by rand()) as seqnum,
  4. count(*) over (partition by department) as cnt
  5. from t
  6. ) t
  7. where seqnum < <your formula based on department size here>;
Add Comment
Please, Sign In to add comment