MySQL Forums
Forum List  »  Newbie

Re: insert in an ordered set, then reorder
Posted by: Marcelo Correa
Date: October 05, 2016 08:07PM

Barry,

a Chinese said wisdom come from simple things, and you just made it simple and effective :) thanks.

That's What I was looking for, I was paddling in another direction :(

to have the same effect I was thinking in letting the weight with even numbers and put the new between them, then reordering.

I will answer your questions for someone with the same question.


>>I will build a webpage with a ranking table (with integer values).

>What determines the rank?

each line in the table will be redirected to a post with a problem where people could decide which one should be solved first (people could vote for it on the post).

>>The ranking column must be consecutive and unique (in case of equality oldest topic wins)

>Can't be unique and have equality. The two are mutually exclusive.

I understand that they are mutually exclusive, What I tried to say is when there is a tie the one with minor weight will be the one with the highest date ".* ORDER BY weight, creation_time". But still thinking on how to do it :)

again thanks for your precious help,

regards,

Options: ReplyQuote


Subject
Written By
Posted
Re: insert in an ordered set, then reorder
October 05, 2016 08:07PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.