简体   繁体   English

如何在访问表中插入具有值行号的列

[英]how to insert a column with value row number in an access table

I have a large access table . 我有一张大桌子。 I need to have a column which will have value as row number how can I write an sql query fill an empty column inserted by me with row numbers 我需要有一个列,该列的值将作为行号,如何编写sql查询以行号填充由我插入的空列

Im sorry, im a little confused at what you're getting at, but could you not just do an alter table? 对不起,我对所要获得的信息有些困惑,但是您不能只做一个变更表吗?

ALTER TABLE my_table
 ADD row_number  int;

使Field数据类型为AutoNumber,它将自动为您完成。

Write a sequence for your table . 为表写一个序列。 Then have default value as sequence . 然后将默认值作为sequence。

So, whenever the column does not get users values , it will take the sequence values. 因此,只要该列没有获得用户值,它将采用序列值。

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

相关问题 如何在表中插入默认值的行? - How to insert a row to table which has a default value in column? 如何基于字段值将可变数量的记录插入到访问表中 - How to Insert a Variable Number of Records into an Access Table Based on a Fields Value 将行插入表中,值不在列中 - Insert row into table where value not in column 如何在ACCESS表行中找到第一列而不是空白值为零? - How to find the first column in an ACCESS table row with a value not Zero of Blank? 如果表中不存在列值,则将行插入表中 - Insert row into table if column value does not already exist in table 如何通过从 SQL Server 中的另一个表中选择列名和值将行插入表中 - How to insert row into a table by select column name and value from another table in SQL Server 如何将其他表中的值插入一行? - How to insert into a row, a value from other table? Mysql的。 如何将带有外键的列的空值插入子表中的行 - Mysql. How to insert row to child table with null value of column that is foreign key 插入表中,而不必为每一行指定每个列值 - Insert into table without having to specify every column value for each row 根据列值在 sql 表中插入行 - Insert row inside sql table based on its column value
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM