A
ArielZusya
I've got a table (tblMain) which stores the seat to which each person in the
table is assigned for a given event. I'm working on writing code that will
take the person sitting in the lowest seat number about a certain range and
move that person into the lowest seat number currently empty below that
range. I've figured out the SQL to accomplish the locating of the lowest
occupied seat above the range and the lowest unoccupied seat below the range
and I've figured out the SQL to move the person sitting in the the seat found
above the range into the seat found below the range. What I don't know is
how to loop this until all seats below the range are filled. I'm sure it is
something relatively simple, I just don't know how to do it. I feel like it
needs to be something like:
While the result of the query for the min of the unoccupied seat less than a
particular value is not null, insert the min of the occupied seat above that
value. I just have never used a loop... though I'm excited to learn how.
Your help will be greatly appreciated! Thanks!
table is assigned for a given event. I'm working on writing code that will
take the person sitting in the lowest seat number about a certain range and
move that person into the lowest seat number currently empty below that
range. I've figured out the SQL to accomplish the locating of the lowest
occupied seat above the range and the lowest unoccupied seat below the range
and I've figured out the SQL to move the person sitting in the the seat found
above the range into the seat found below the range. What I don't know is
how to loop this until all seats below the range are filled. I'm sure it is
something relatively simple, I just don't know how to do it. I feel like it
needs to be something like:
While the result of the query for the min of the unoccupied seat less than a
particular value is not null, insert the min of the occupied seat above that
value. I just have never used a loop... though I'm excited to learn how.
Your help will be greatly appreciated! Thanks!