I have a code where I need to pull 400 random employees from this list of over 60,000. THere are 8 different job groupings, I need a certain number of each from each grouping. So of the total 400 random samples I need that 400 needs to consist of specific numbers from each of the 8 groups. This is the code so far:
SELECT TOP (400) Business_Unit, GEMSID, First_Name, Last_Name, Region, District, Job_Function, Email_Address, Job_Group_Code
FROM dbo.v_TMS_employee_HR
ORDER BY NEWID()
IE: Of the 400 random records returned: Group 1 needs to have 45, Group 2 needs 50, Group 3 needs 35, Group 4, needs 25, Group 5 needs 100, Group 6 needs 5, Group 7 needs 70 and Group 8 needs 70.
And each group is made up of 1-4 different job codes.