简体   繁体   English

强制在表末尾插入新记录?

[英]force new record to be inserted at the end of table?

whenever i delete a record and then insert new one, new record is inserted at the deleted index? 每当我删除一条记录然后插入新记录时,新记录就会插入到已删除的索引处? how can i force new record to be inserted at the end of table? 如何强制将新记录插入表的末尾?

the short answer is that you can't. 简短的答案是你做不到。 The slightly longer answer is that RDBMS technology is based on set-theory and that database tables, like sets, have no distinct order. 稍长一点的答案是,RDBMS技术基于集合论,而数据库表(如集合)没有明确的顺序。 If you need it to be at the end when you query for that data, I would add an insertion_date field to the table and order by that field in your query. 如果您需要在查询该数据时将其结尾,则可以在表中添加一个insert_date字段,并按查询中的该字段排序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 插入新记录时,将一个表中的ID插入另一个表中 - Inserting an ID from one table into another when a new record is inserted 当新记录插入另一个表时更新计数器字段 - Update counter field when a new record inserted on another table 登录警报框后,表上已插入新记录 - Alert box once logged in that there's a new record inserted on a table 为在表中插入新的mysql记录时创建Node.js事件侦听器(用于通知Feed) - Creating a Node.js event listener for when there is a new mysql record inserted into table (For Notification Feed) 调用php脚本作为插入db的新记录 - Invoke a php script as a new record inserted into db 如何检查新记录是否插入到Java中的数据库 - How to check the new record is inserted or not to db in java 在数据库中插入新记录时显示通知 - display a notification when new record is inserted in the Database 如何查找。是否插入了新记录? - How to find.Is new record is inserted or not? 当我们在糖中创建新记录时,字段将插入两个或多个表中,如何从MySQL查询中实现 - when we create a new record in sugar the fields will be inserted into two or more table how this can be achieved from MySQL query 将新数据插入表中后发送电子邮件 - Send an Email when new data is inserted into the table
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM