I have an employee table where the product is owned by multiple employees. I need to filter 1 employee per product based on below conditions.
1. Emp who has Max stock %
2. If the stock % is equal then go for employee who has longest tenure (Emp end dt - emp st dt)
3. if the stock % is equal and employee tenure is also equal take the min of emp No.
|Emp No||Stock %||Product No||Emp st dt||Emp End dt|
|Emp No||Stock %||Product No|
Solved! Go to Solution.