From: kalle volkov Date: March 11 1999 2:07pm Subject: Re: sort of defragmentation? List-Archive: http://lists.mysql.com/mysql/24 Message-Id: <36E7CE18.22F1@tank.ee> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit hi! with 2 SQL statements u can do it easily: --- DELETE FROM table WHERE ID = 5; UPDATE table SET ID = ID - 1 WHERE ID > 5; --- regs, cal6 Mike Otto wrote: > > Hi! > > I'm using MySQL 3.22.14b-gamma on a Linux Box. > > Lets say I have this little table: > > ID Article > > 1 strawberrys > 2 lemons > 3 apples > 4 flowers > > After: Delete * from table where ID='2' > the table looks like this > > ID Article > > 1 strawberrys > 3 apples > 4 flowers > > In this table I'm missing the ID=2 > > So here is my question: > > I would like to run a Query (or whatever) to make > the table look like this: > > 1 strawberrys > 2 apples > 3 flowers > > (sorted order, without missing IDs) > > Does somebody know how to do it? > Did I oversee something in the manual? > > Thanks in advance and BTW: Many thanks to Monty and > all the others in this mailinglist teaching me everyday > how to use MySQL. > > Mike > > -- > Mike Otto - mikeqdai@stripped >