This is a discussion on Another Numbering question within the MySQL forums, part of the Database Server Software category; --> A few days ago, Rik gave me the following code that renumber the fieldname column with consecutive numbers. It ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| A few days ago, Rik gave me the following code that renumber the fieldname column with consecutive numbers. It worked fine when I ran it directly, but I'm having difficulty in creating a procedure to do this. I'm still new to databases in general and mysql more specifically. I've set up stored procedures before, but I can't seem to get it right when I add in the set @myvar statement on the first line. Any suggestions? SET @myvar := 0; UPDATE tablname SET fieldname = @myvar:= @myvar + 1 ORDER BY fieldname; -- Rik Wasmus -- Posted via a free Usenet account from http://www.teranews.com |