开发者

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

开发者 https://www.devze.com 2022-12-21 11:59 出处:网络
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 ins开发者_运维知识库erted by me with row numbersWrite a sequ

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 ins开发者_运维知识库erted by me with row numbers


Write a sequence for your table . Then have default value as sequence .

So, whenever the column does not get users values , it will take the sequence values.


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;


Make the Field DataType AutoNumber it will do it for you automatically.

0

精彩评论

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