Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select t.*
- from (select t.*,
- row_number() over (partition by department order by rand()) as seqnum,
- count(*) over (partition by department) as cnt
- from t
- ) t
- where seqnum < <your formula based on department size here>;
Add Comment
Please, Sign In to add comment