我想知道你们是否可以帮助我在单个查询中简化以下查询。
我有 10 个查询,就像下面的查询一样。它们之间的唯一区别是字段“Outcoming Task”,它从 1 开始一直到 10。
SELECT
S1.[Main Project] AS Company,
S1.[Main Link] AS Project,
S1.[Name] AS Milestone,
S1.[Start] AS MilestoneDueDate,
S2.[Name] AS Successor,
S2.[Start] AS SuccessorDueDate
FROM Sheet1 AS S1 INNER JOIN Sheet1 AS S2 ON S1.[Outcoming Task 1] = S2.[ID]
WHERE
S1.Start >S2.[Start] AND
S1.[%compl#] <> 100 AND
(S1.[Task class] <> '***Sammelvorgang' AND S1.[Task class] <> '' AND S1.[Task class] <> 'M D-Muster') AND
(S2.[Task class] <> '***Sammelvorgang' AND S2.[Task class] <> '' AND S2.[Task class] <> 'M D-Muster')
ORDER BY
S1.[Main Project],
S1.[Main Link],
S1.[Name];
我创建它的原因是因为 DBA 没有为任务之间的连接创建表,而是创建了 10 个字段,例如 Outcoming Task 1、Outcoming Task 2 和 Outcoming Task 3 ......
是否可以将所有查询合并到一个查询中?各位大神可以给点建议吗?
信息:MS-ACCESS 2010
谢谢,