How do I get a column with consecutive, increasing numbers, without having any numbers missing?

Adapted this from a previous answer. This kind of stuff happens often when applications want a tabbing-order for variables (read: records in an EAV model) , which could also be (part of) an alternate key. the priority field needs to be kept consecutive. [this is the tabbing-order] on INSERT: all records with priority >= the … Read more