开发者

update column by row number

I have one table that contain lots of records and I want to update my primary key开发者_运维技巧 by row number. My database is MySQL.


You shouldn't do that.
There is not a thing called "row number" in the database.
Such a number can be applicable only to output of certainly ordered and filtered data, but not to stored one.

Leave your primary key alone, it identifies the whole record, not it's "position" (especially because there is no position at all).

Why do you need that? Your task has another solution for sure, a proper one


mysql isn't Oracle and doesn't support rownum.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜