Randomize part of select from CTE output
问题 In this question @GordonLinoff provided a solution (recursive common table expression) to my initial question. This is a follow-up question. Initial question : How can I loop through registrations until a certain amount (sum) of AmountPersons was reached and if the next AmountPersons was too high to be invited check the AmountPersons of the next row to see if it would fit? Please check the initial question via the link above to get the full picture. New situation : First we have 20 available