如何在MS Access查询中生成序列号列? [英] How to Generate Serial Number Column in MS Access Query?

查看:296
本文介绍了如何在MS Access查询中生成序列号列?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在MS Access查询中生成序列号列以及其他记录。



例如。



AAA 32

BBB 12

CCC 23



输出应该是:



1 AAA 32

2 BBB 12

3 CCC 23

How to Generate Serial Number Column in MS Access Query along with other Records.

For Eg .

AAA 32
BBB 12
CCC 23

Output Should be :

1 AAA 32
2 BBB 12
3 CCC 23

推荐答案

使用Autonumber类型向数据库添加Identity列。
Add an Identity column to your database with the type "Autonumber".


可以使用DCOUNT()函数实现指定相对参考。要求col。
It can be achieved using DCOUNT() Function Specifying relative ref. to required col.


不能在Ms Access Table上写这种查询,只在执行查询时有序列号。您必须在Ms Access Table中添加一列,如前面的答案中所述,以获取输出中的序列号。
It is not possible to write such kind of query on Ms Access Table to have serial number at the time of executing query only. You have to add a column in Ms Access Table as describe in previous answer to get Serial Number in Output.


这篇关于如何在MS Access查询中生成序列号列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆