MySQL Forums
Forum List  »  Newbie

Re: insert in an ordered set, then reorder
Posted by: Barry Galbraith
Date: October 05, 2016 03:33PM

What do you mean by
insert/update (orange, 2) before red or after blue
Do you mean increment the value of 'weight' for every row where weight > 1?
That would allow orange with weight 2 to be added.

Sounds like bad table design, but if that is want you want, sounds like I might have suggested your UPDATE query to allow (orange, 2) to be inserted.

The ORDER you get the rows is set by you with ORDER BY clause when you retrieve the data.

Good luck,
Barry.

Options: ReplyQuote


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


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.