且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在查询结果上创建行号或行号。

更新时间:2023-11-17 14:02:40

我担心这在逻辑上是不可能的,因为没有订单的定义,并且SQL没有识别每行的序数的概念,或者换句话说,记录位置的概念。 br />

有很多方法可以在代码(VBA程序)中摆弄它,但从根本上说这是不受支持的。
I''m afraid this is logically impossible, as there is no definition of the order, and SQL doesn''t recognise the concept of ordinal numbers per line, or to put it another way, of record positions.

There are ways of fiddling this in code (VBA procedures) but fundamentally this is not supported.


好的,所以我需要找到一种方法创建一个包含每行唯一值的新字段。如果我用表达式执行此操作,可以说将其他两个字段连接成新的字段,使其独一无二,那么我可以将它与count函数一起使用吗?


这看似简单的事情已经成为我项目的一个主要障碍。


我已经读过记录号或者自动递增的号码可以添加到报告中。这可以工作,只要我可以将报告导出到csv文件。


Chad
OK, so I need to find a way of making a new field that contains a unique value for each line. If I did this with an expression, lets say concatenating two other fields into new one such that it is unique, could I then use that with the count function?

This seemingly-simple thing has turned into a major roadblock for my project.

I''ve read that record numbers or an auto-incrementing number could be added to a report. This would work, as long as I could export the report to a csv file.

Chad


可能,但报告没有以您需要的格式列出。导出报告就是这样,显示的数据,而不是基础记录源。


我不敢说理解数据库的人永远不会认为这是一个简单的问题。对于那些不理解他们正在尝试做什么的人来说,这似乎只是那种方式。
Possible, but reports are not laid out in the format you''d need. Exporting a report does just that, the displayed data, not the underlying record source.

I''m afraid to say that people who understand databases never see this as a straightforward issue. It can only seem that way to those who don''t appreciate what it is they''re trying to do.