Page 1 of 1

help with renumbering sequence in mySQL db

Posted: Sun Jul 02, 2006 9:32 pm
by dangre
Hello,

I'm attempting to add a standard sequence (increments of 1) for all records meeting a given criteria. My SQL select statement would look something like this:

Code: Select all

mysql_query("SELECT * FROM myTable WHERE city='Tampa' ORDER BY recordSequence ASC")
There may be dozens of records that meet it's given criteria. So --- for every record found, UPDATE the first record with a sequence of 1, next record with a sequence of 2, etc. until the recordset is finished.

Any ideas are extremely appreciated. Thank you!!

Posted: Sun Jul 02, 2006 10:02 pm
by wildwobby
So you want numbers to be added to the MySQL db by the order it outputs?

Posted: Mon Jul 03, 2006 10:29 pm
by dangre
Yes, that is correct. :)