如何使用更新了 autonum 字段的 mysql 在现有行之间插入新行
How to insert a new row between existing rows using mysql with autonum field updated
MySQL 数据库目前列出了旧约中的每个希伯来语单词,除了这个在数据库创建期间未能插入数据库的希伯来语单词(可能还有其他遗漏)。单词输入数据库的顺序很重要,因为此时可以确定句子的顺序。遗漏发生在单词 26553 处,这意味着在 26553 处有单词 26554,在 26554 处有单词 26555 等。那么是否有一个 SQL 语句将插入记录并正确地将以下 AUTONUM 字段重新定义为正确的数字?如果没有,那么是否有一个功能,也就是可以遵循的过程来产生所需的结果?
我目前通过C-Panel_App[phpMyAdmin}
编辑数据库设置
phpMyAdmin 4.3.8 文档下 »
要求
网络服务器
由于 phpMyAdmin 的界面完全基于您的浏览器,因此您需要一个 Web 服务器(例如 Apache、IIS)来安装 phpMyAdmin 的文件。
PHP
You need PHP 5.3.0 or newer, with session support, the Standard PHP Library (SPL) extension, JSON support, and the mbstring extension.
To support uploading of ZIP files, you need the PHP zip extension.
You need GD2 support in PHP to display inline thumbnails of JPEGs (“image/jpeg: inline”) with their original aspect ratio.
When using the cookie authentication (the default), the mcrypt extension is strongly suggested.
To support upload progress bars, see 2.9 Seeing an upload progress bar.
To support XML and Open Document Spreadsheet importing, you need the libxml extension.
Performance suggestion: install the ctype extension.
另见
1.31 phpMyAdmin 是否支持 PHP5?, 使用身份验证模式
数据库
phpMyAdmin 支持 MySQL 兼容的数据库。
MySQL 5.5 or newer
MariaDB 5.5 or newer
Drizzle
另见
1.17 phpMyAdmin 支持哪些 MySQL 版本?
网络浏览器
要访问 phpMyAdmin,您需要一个带有 cookie 并启用 javascript 的网络浏览器。
如果您需要更多信息,请提供获取信息的说明,谢谢。
使用 PHP、MySQL 或两者组合的答案将不胜感激。非常感谢。如果需要对数据库进行更改,也将不胜感激如何通过 phpMyAdmin 进行更改的说明。
首先修改table,使'id'列不再是PRIMARY KEY(你可能需要先去掉它的自增行为)。
将列名称更改为 sequence_no
更新 table 以便每个 sequence_no >= 26553 添加 1。
4、添加一个新的自增主键列id。
- 插入缺失的行。将其 sequence_no 分配为 26553。其 id 将由自动增量器选择。
在您的查询中,按 sequence_no 对结果集进行排序。
重复第 3 步和第 5 步以解决任何其他遗漏问题
MySQL 数据库目前列出了旧约中的每个希伯来语单词,除了这个在数据库创建期间未能插入数据库的希伯来语单词(可能还有其他遗漏)。单词输入数据库的顺序很重要,因为此时可以确定句子的顺序。遗漏发生在单词 26553 处,这意味着在 26553 处有单词 26554,在 26554 处有单词 26555 等。那么是否有一个 SQL 语句将插入记录并正确地将以下 AUTONUM 字段重新定义为正确的数字?如果没有,那么是否有一个功能,也就是可以遵循的过程来产生所需的结果?
我目前通过C-Panel_App[phpMyAdmin}
编辑数据库设置phpMyAdmin 4.3.8 文档下 »
要求
网络服务器
由于 phpMyAdmin 的界面完全基于您的浏览器,因此您需要一个 Web 服务器(例如 Apache、IIS)来安装 phpMyAdmin 的文件。
PHP
You need PHP 5.3.0 or newer, with session support, the Standard PHP Library (SPL) extension, JSON support, and the mbstring extension.
To support uploading of ZIP files, you need the PHP zip extension.
You need GD2 support in PHP to display inline thumbnails of JPEGs (“image/jpeg: inline”) with their original aspect ratio.
When using the cookie authentication (the default), the mcrypt extension is strongly suggested.
To support upload progress bars, see 2.9 Seeing an upload progress bar.
To support XML and Open Document Spreadsheet importing, you need the libxml extension.
Performance suggestion: install the ctype extension.
另见
1.31 phpMyAdmin 是否支持 PHP5?, 使用身份验证模式
数据库
phpMyAdmin 支持 MySQL 兼容的数据库。
MySQL 5.5 or newer
MariaDB 5.5 or newer
Drizzle
另见
1.17 phpMyAdmin 支持哪些 MySQL 版本? 网络浏览器
要访问 phpMyAdmin,您需要一个带有 cookie 并启用 javascript 的网络浏览器。
如果您需要更多信息,请提供获取信息的说明,谢谢。 使用 PHP、MySQL 或两者组合的答案将不胜感激。非常感谢。如果需要对数据库进行更改,也将不胜感激如何通过 phpMyAdmin 进行更改的说明。
首先修改table,使'id'列不再是PRIMARY KEY(你可能需要先去掉它的自增行为)。
将列名称更改为 sequence_no
更新 table 以便每个 sequence_no >= 26553 添加 1。
4、添加一个新的自增主键列id。
- 插入缺失的行。将其 sequence_no 分配为 26553。其 id 将由自动增量器选择。
在您的查询中,按 sequence_no 对结果集进行排序。
重复第 3 步和第 5 步以解决任何其他遗漏问题