Click to See Complete Forum and Search --> : Maintaining correct sequence


Yelgnidroc
10-11-2007, 08:23 AM
I have a database that has offers in it.

The table has a sequence column which determine the display order of queries. The sequence goes up in 10's. So, if you wanted to add a record between records one and two, you would give it a sequence between 10 and 20, usually 15.

I need to be able to resequence the sequences as part of housekeeping otherwise they can get messy. By resequence I mean find the lowest sequence, assign it the value of 10, find the next lowest, assign it 20 etc etc

Is there a single query to do this? If not, what the most efficient way? (I'm okay with php if that's what's required)