Say I have a table for "users" consisting of "group_id" and "group_rank"
I have a table for all groups and their group information, including ID.
I have a support table for all ranks for all groups, with keys as "group_id" and "sort_id" (sort_id so I can swap a rank up and down.) I do not have the luxury of just referring to the ranks unique id reference key as sort_id only has this many values it can support (1 through 50)
I realize the most efficient way to solve the issue would be to have users "group_rank" refer to the rank support tables unique ID, however I don't have that luxury unfortunately, so it has to refer to "sort_id" based on "group_id" from both rank/users table.
Now, tricky part, I want to swap two ranks' sort position. I've done that efficiently enough with a swap query ( how to update swap values of two rows with single query )
However, I want to do the same for all "users" affected. Is there any easier way than fetching all users with group_id match and process through them then create 2 new queries to update for their separate new rank_id's ?