这应该很容易,不应该吗?不是最小查询 [英] This should be easy, shouldn't it? Not Min query

查看:75
本文介绍了这应该很容易,不应该吗?不是最小查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我有一张表,每周会附加一条记录。在我的追加查询中,我有一个字段来确定何时使用Now()追加它。现在我要做的是删除后面附加的相同记录,这样每条记录只应在第一次附加时出现。


所以我基本上都想尝试选择所有记录在附加日期不是MIN的记录,因此我可以将其转换为删除查询。我希望这很清楚吗?我该怎么做?


非常感谢你的帮助。

Hi,

I have a table which will have records appended to it weekly. In my append query I have a field to identify when it was appended using Now(). Now what I want to do is delete the identical records that were appended later so each record should only appear when they were appended for the first time.

So I basically am trying to select all the records that are not MIN on the appended date so I can then turn it into a delete query. I hope this is clear? How would I do this?

Your help is much appreciated.

推荐答案

让聚合查询返回min每组的记录。

使用... WHERE ... Not In ...删除查询中的语法。


问候,

Fish。
Make an aggregating query returning "min" records for each group.
Use "... WHERE ... Not In ..." syntax in your delete query.

Regards,
Fish.


我正在摸索SQL并且它''没有按照它说的去做。如果我给出了一个小例子的情况,也许你可以帮助SQL。


表附加记录进入=DMH

字段识别当记录每条记录时附加=更新日期

其他字段包括="名称",ADM_AOS_CODE,电子邮件


查询选择最早的附加记录,我要保留的记录=DMEU
I am fumbling around SQL and it''s not doing what it''s told. If I gave a mini example of the situation, maybe you could help with the SQL.

Table appeded records go into = "DMH"
Field identifying when record each record was appended = "Updated Date"
Other fields include = "Name", "ADM_AOS_CODE", "Email"

Query selecting earliest Appended records, the records I want to keep = "DMEU"


什么字段定义从哪个记录组返回最早的记录?
What field defines record groups from which earliest records are to be returned?


这篇关于这应该很容易,不应该吗?不是最小查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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