1

我正在尝试在访问中运行查询,但我不断收到一条错误消息,阻止我运行它。是查询太大还是我的电脑太慢了?这是一台非常旧的计算机,所以我认为这是最有可能的情况,也是戴尔。当我不选择 DISTINCT 时查询有效,但当我选择时查询无效。但是,我得到了太多重复,所以我需要 DISTINCT。

SQL 代码:

SELECT DISTINCT [ECOG 2809 ICORG 11-04].Title, 
  [Anti-Mullerian AMH_SVU_1].Name, 
  [Tarceva Biomarker ICORG 11-21].Name, 
  [Pfizer Archer].Name, 
  [Collaborative Biomarker Study].Name, 
  [MYOCET ICORG 10-03].Name, 
  [doVe Electro-Chemo].[First name], 
  [Spinal Compression].Title, 
  SNP.Title, SNP.[First Name], 
  [PET -CT LUNG 06-35].[First Name], 
  CharactHer.[First Name], 
  [Perfosine Myslemo].[First Name], 
  SWOG_1.Name, 
  [Phase 2].[First Name], 
  SIVUH.Name, 
  SLRON.Name, 
  [Spinal Cord Retreat].[First name], 
  [doVe Electro-Chemo].[First name], 
  [Circulating miRNAs ICORG 10-11].[First Name], 
  Endomentrial.Title, 
  [Pfizer Archer].Name, 
  [IMRT Prostate].[First name], 
  Glioma.[First name], 
  [Genito Urinary].[First name], 
  [GSK VEG113387 ICORG 11-05].[First name]
FROM [TH v THL], 
  [Tarceva Biomarker ICORG 11-21], 
  SWOG, 
  SWOG AS SWOG_1, 
  [Spinal Cord Retreat], 
  [Spinal Compression], 
  SNP, 
  SLRON, 
  [Phase 2], 
  SIVUH, 
  [Pfizer Archer], 
  [PET -CT LUNG 06-35], 
  [Perfosine Myslemo], 
  [MYOCET ICORG 10-03], 
  [IMRT Prostate], 
  [GSK VEG113387 ICORG 11-05], 
  Glioma, 
  [Genito Urinary], 
  Endomentrial, 
  [ECOG 2809 ICORG 11-04], 
  [doVe Electro-Chemo], 
  [Collaborative Biomarker Study], 
  [Circulating miRNAs ICORG 10-11], 
  CharactHer, 
  [Biomarkers of Response Taxotere], 
  ANZGOG, 
  [Anti-Mullerian AMH_SVU], 
  [Anti-Mullerian AMH_SVU] AS [Anti-Mullerian AMH_SVU_1]
WHERE 
(
  (
    ([ECOG 2809 ICORG 11-04].Title) Is Null 
      Or ([ECOG 2809 ICORG 11-04].Title) Between "A" And "G"
  ) 
  AND 
  (
    ([Anti-Mullerian AMH_SVU_1].Name) Is Null 
      Or ([Anti-Mullerian AMH_SVU_1].Name) Between "A" And "G"
  ) 
  AND 
  (
    ([Tarceva Biomarker ICORG 11-21].Name) Is Null 
      Or ([Tarceva Biomarker ICORG 11-21].Name) Between "A" And "G"
  ) 
  AND 
  (
    ([Pfizer Archer].Name) Is Null
      Or ([Pfizer Archer].Name) Between "A" And "G"
  ) 
  AND 
  (
    ([Collaborative Biomarker Study].Name) Is Null 
      Or ([Collaborative Biomarker Study].Name) Between "A" And "G"
  ) 
  AND 
  (
    ([MYOCET ICORG 10-03].Name) Is Null 
      Or ([MYOCET ICORG 10-03].Name) Between "A" And "G"
  ) 
  AND 
  (
    ([doVe Electro-Chemo].[First name]) Is Null 
      Or ([doVe Electro-Chemo].[First name]) Between "A" And "G"
  ) 
  AND 
  (
    ([Spinal Compression].Title) Is Null 
      Or ([Spinal Compression].Title) Between "A" And "G"
  ) 
  AND 
  (
    (SNP.Title) Is Null 
      Or (SNP.Title) Between "A" And "G"
  ) 
  AND 
  (
    (SNP.[First Name]) Is Null 
      Or (SNP.[First Name]) Between "A" And "G"
  ) 
  AND 
  (
    ([PET -CT LUNG 06-35].[First Name]) Is Null 
      Or ([PET -CT LUNG 06-35].[First Name]) Between "A" And "G"
  ) 
  AND 
  (
    (CharactHer.[First Name]) Is Null 
      Or (CharactHer.[First Name]) Between "A" And "G"
  ) 
  AND 
  (
    ([Perfosine Myslemo].[First Name]) Is Null 
      Or ([Perfosine Myslemo].[First Name]) Between "A" And "G"
  ) 
  AND 
  (
    (SWOG_1.Name) Is Null 
      Or (SWOG_1.Name) Between "A" And "G"
  ) 
  AND 
  (
    ([Phase 2].[First Name]) Is Null 
      Or ([Phase 2].[First Name]) Between "A" And "G"
  ) 
  AND 
  (
    (SIVUH.Name) Is Null 
      Or (SIVUH.Name) Between "A" And "G"
  ) 
  AND 
  (
    (SLRON.Name) Is Null 
      Or (SLRON.Name) Between "A" And "G"
  ) 
  AND 
  (
    ([Spinal Cord Retreat].[First name]) Is Null 
      Or ([Spinal Cord Retreat].[First name]) Between "A" And "G"
  ) 
  AND 
  (
    ([doVe Electro-Chemo].[First name]) Is Null 
      Or ([doVe Electro-Chemo].[First name]) Between "A" And "G"
  ) 
  AND 
  (
    ([Circulating miRNAs ICORG 10-11].[First Name]) Is Null 
      Or ([Circulating miRNAs ICORG 10-11].[First Name]) Between "A" And "G"
  ) 
  AND 
  (
    (Endomentrial.Title) Is Null 
      Or (Endomentrial.Title) Between "A" And "G"
  ) 
  AND 
  (
    ([Pfizer Archer].Name) Is Null 
      Or ([Pfizer Archer].Name) Between "A" And "G"
  ) 
  AND 
  (
    ([IMRT Prostate].[First name]) Is Null 
      Or ([IMRT Prostate].[First name]) Between "A" And "G"
  ) 
  AND 
  (
    (Glioma.[First name]) Is Null 
      Or (Glioma.[First name]) Between "A" And "G"
  ) 
  AND 
  (
    ([Genito Urinary].[First name]) Is Null 
      Or ([Genito Urinary].[First name]) Between "A" And "G"
  ) 
  AND 
  (
    ([GSK VEG113387 ICORG 11-05].[First name]) Is Null 
      Or ([GSK VEG113387 ICORG 11-05].[First name]) Between "A" And "G")
);

错误信息

无法完成查询。查询结果的大小大于数据库的最大大小(2GB)或者磁盘上没有足够的临时存储空间来存储查询结果

4

2 回答 2

2

(1) 当您在 Access 查询设计器中进行查询时,您必须在表之间画一条线以通过主键连接它们。哪个,我猜你不能去,因为...

(2) 导入数据的方式对数据库模式没有意义。一方面,它们的方式(每个表一项研究,我猜是“名称”字段)与设计合理的数据库相距甚远,以至于毫无用处。

例如,30 多个这样的表:

  • 表名=[研究的名称]
    由特定数据项命名的表是设计错误的死板。您应该能够在不更改表结构的情况下输入新数据。因此,数据库表更贴切地以其中的数据类型命名
  • 表包含:铂。名字,(其他东西)。没关系。

(3) 另一方面,它应该是非常简单的。您不需要任何连接。

  • 一张名为 StudyParticipants 的表。
  • 2+ 字段:StudyName、Pt_Name、(其他字段)
  • [如果你真正开始编程,你会有其他表格,例如,'studies'等]

(4) 我猜这样的设计不是因为你想要那样,而是因为这就是导入的方式。您可能有一个电子表格,每个研究都有一个标签。我也可以说出来,因为名字字段略有不同。

如果你想使用数据库,那是行不通的。你最好写一个宏来循环你的excel表。

(5) 如果要正确导入,则必须先创建一个表,其中的列与任何工作表上所有可能的列匹配。然后,您必须一次导入一张工作表,每次发生时,对于与工作簿中工作表的选项卡名匹配的整个工作表的数据库的 StudyName 字段。

一个可悲的预测,这是真的。

当然,在执行所有这些操作之前,您可以创建一个查询,尝试将它们全部合并到一个大表中(使用 AS 子句将不同的名称字段重命名为一个),然后在 union'd 上运行查询看法。

于 2013-05-10T15:52:52.660 回答
0

评论太大了:

我正在努力寻找看起来像这样返回的结果的含义:

[ECOG 2809 ICORG 11-04].Title   [Anti-Mullerian AMH_SVU_1].Name [Tarceva Biomarker ICORG 11-21].Name    ...
-----------------------------   ------------------------------- ------------------------------------
null                            null                            null
A                               null                            null
A                               A                               null
...
G                               G                               F
G                               G                               G

似乎没有任何关系。

您能否向我们展示一个表模式、一些示例数据和所需的输出?您可能必须考虑表和列的名称来弥补数据。我想知道您的数据是否以无意义的方式导入 Access?

于 2013-05-10T15:17:31.127 回答