ellejay123
New member
- Local time
- Today, 06:11
- Joined
- Mar 9, 2017
- Messages
- 2
I have a table with employee names and order numbers they are responsible for. I want to be able to randomly select 2 orders for each employee.
For example I have a list of 10 orders assigned to 4 employees:
Employee | Order #
Adam | 1
Adam | 2
Adam | 3
Betty | 4
Betty | 5
Betty | 6
Betty | 7
Carl | 8
Carl | 9
Dave | 10
And I want to return something like the following results:
Employee | Order #
Adam | 1
Adam | 3
Betty | 4
Betty | 5
Carl | 8
Carl | 9
Dave | 10
Everything I've found so far has been just returning 5 random entries, or 10 random entries. But I haven't found anything that allows for the grouping on another field such as Employee.
For example I have a list of 10 orders assigned to 4 employees:
Employee | Order #
Adam | 1
Adam | 2
Adam | 3
Betty | 4
Betty | 5
Betty | 6
Betty | 7
Carl | 8
Carl | 9
Dave | 10
And I want to return something like the following results:
Employee | Order #
Adam | 1
Adam | 3
Betty | 4
Betty | 5
Carl | 8
Carl | 9
Dave | 10
Everything I've found so far has been just returning 5 random entries, or 10 random entries. But I haven't found anything that allows for the grouping on another field such as Employee.