Home >Database >Mysql Tutorial >mysql在已有的表中插入记录行号_MySQL

mysql在已有的表中插入记录行号_MySQL

WBOY
WBOYOriginal
2016-06-01 13:43:321094browse

bitsCN.com
mysql在已有的表中插入记录行号 1.先在已有的表中增加一列,用这一列来存记录行号
2.将记录行号插入表的这个新增字段中如:SET @mycnt = 0; UPDATE datamanagementSET rownum=(@mycnt := @mycnt + 1)WHERE industryid='38'ORDER BY dataid   作者 zdk8105 bitsCN.com

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn