question

arunaponugupati avatar image
arunaponugupati asked

SQL: How to distribute records to employees based on their highest capacity available?

Hi, As per our requirement, I should assign records to employees based on their capacity and category and other attributes. As per the earlier post, i was able to assign records evenly. But I need to look at the employee capacity also. For example, if an employee has 30 capacity, he can get assigned more records than the person with lowest capacity. If that employee reaches 0 capacity, i should take him of the list and start assigning. I tried a cursor for row by row processing and round robin as well. But i am not getting desired output. Please advise.
distributedroundcapacity
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

0 Answers

·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.