indexing - Create ordering in a MySQL table without using a number (because then it's hard to put something in between) -


I have a long list of items in a monthly table (say, some million items), let's call it mytable And it's mytable.itemid field.

Items are ordered, and can be re-ordered by the user by drag and drop if I add a field named mytable.order and put the number in them, then it creates problems Does: What if I want to move an item between 2 other items? Then all the order fields need to be updated? It seems like a nightmare.

Is there a way in adding a command to a table, which changes each item according to a number, accordingly, and separates the order of the SQL queries every time?

You can create triggers or stored functions to properly remove order value, or all associated records And insert new people into new orders.


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -