title: SQL Server: Alternate Assigning a Row based on a criteria
body: <p>I am creating a work flow spreadsheet were I want to equally distribute the list based on the location between members of the team.</p>
  
  <p>I.E. 
  10 rows to assign in 2 states, broken down as follows:</p>
  
  <p>7 rows in Virginia</p>
  
  <p>3 rows in Utah</p>
  
  <p>I want to assign the rows in each state to the members of the team in that state.</p>
  
  <p>So if Jane and John are the team members for Utah and Jack and Jill were the team members for Virginia it would assign like so:</p>
  
  <pre><code>Row 1  || AcctNo || City || Virginia || Jill
  
  Row 2  || AcctNo || City || Utah     || Jane 
  
  Row 3  || AcctNo || City || Utah     || John
  
  Row 4  || AcctNo || City || Virginia || Jack
  
  Row 5  || AcctNo || City || Utah     || Jane
  
  Row 6  || AcctNo || City || Virginia || Jill
  
  Row 7  || AcctNo || City || Virginia || Jack
  
  Row 8  || AcctNo || City || Virginia || Jill
  
  Row 9  || AcctNo || City || Virginia || Jack
  
  Row 10 || AcctNo || City || Virginia || Jill
  </code></pre>
  
  <p>Any ideas on how to do this? Thanks!</p>
  
  <p>edit:</p>
  
  <p>@BaconBits essentially this is what the data looks like now: </p>
  
  <p><a href="https://i.stack.imgur.com/RqLR6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RqLR6.png" alt="enter image description here"></a></p>
  
  <p>I want to assign the rows like
  case when State = Virginia then 'Jill' or 'Jack' (alternating)
       when State = Utah then 'Jane' or 'John' (alternating)</p>
  
  <p>So it looks like this:</p>
  
  <p><img src="https://i.stack.imgur.com/6zbEz.png" alt="enter image description here"></p>
  
  <p>Edit 2:</p>
  
  <p>My query looks like this:</p>
  
  <p><img src="https://i.imgur.com/zPmQO1i.jpg" alt="enter image description here"></p>