|
|
How to increment the values of a field already in the databaseLet suppose you have a table with some empty title fields and you want to alter them to have values like title1, title2, title3, title4 ... and so onSo if you want to increment the value of a field already in database you could use this MySQL query: ~~#FF0000: SET @count=0; update table set title = (SELECT CONCAT('title',@count:=@count + 1)) where title=''; ~~ MySQL categoriesMySQL installation? MySQL configuration? MySQL Howtos MySQL troubleshooting? Back to > Programming |
Google SearchRandom PagesLogin |