注意:我正在使用 SQL 2000。
我想通过为此加入执行类似的操作来选择 t2.JobCompletionTime 的 MAX 日期的行,但我知道这不是正确的代码/语法,因为它不起作用......但我希望很清楚我是什么我正在尝试做。
LEFT OUTER JOIN (
SELECT *
FROM DSM_StandardProcedureActivityView
WHERE
( (PackageName = 'Adobe Acrobat 10' AND PackageVersion = '-1.0') AND
(MAX (JobCompletionTime))
)
) t2 ON t1.UUID = t2.UUID
我现在的完整工作 SQL 代码是:
SELECT
t1.Business,
t1.[Sub-Business],
t1.Pole,
t1.DomainManager,
t1.ScalabilityServer,
t1.Location,
t1.Country,
t1.Name,
t3.VolumeName,
t3.VolumeFreeInMB,
t3.VolumeSizeInMB,
FROM (
SELECT *
FROM DSM_StandardGroupMembersView
WHERE
( GroupName = 'Adobe Acrobat'
)
) t1
LEFT OUTER JOIN (
SELECT *
FROM DSM_StandardProcedureActivityView
WHERE
( (PackageName = 'Adobe Acrobat 10' AND PackageVersion = '-1.0')
)
) t2 ON t1.UUID = t2.UUID
LEFT OUTER JOIN (
SELECT *
FROM DSM_StandardHardwareDiskUsageView
WHERE VolumeName = 'C:\'
) t3 ON t1.Name = t3.Name
ORDER BY t1.Business, t1.[Sub-Business], t1.Pole, t1.DomainManager, t1.ScalabilityServer, t1.Country, t1.Location, [Job Status], t1.Name