我对 SQL server 的 T-SQL 更有经验,但我一直在 Access 中工作。我的问题是如何为具有自己的连接操作的子查询提供别名。我相信我在谈论嵌套连接操作。我知道我可以创建一个单独的查询,但我没有其他需要,并且希望尽可能保持对象列表干净。我当前的代码如下,我只显示 from 语句,因为它是错误的来源:
FROM
(
(
tblPropertySpecs
INNER JOIN
(
tblAssignedBuildingTypes
INNER JOIN qryAllPropertyIDs
ON tblAssignedBuildingTypes.PropertySpecID = qryAllPropertyIDs.PropertySpecID
)
ON (tblPropertySpecs.PropertySpecID = tblAssignedBuildingTypes.PropertySpecID)
AND (tblPropertySpecs.PropertySpecID = qryAllPropertyIDs.PropertySpecID)
)
INNER JOIN
(
tblRefConstructionTypes
INNER JOIN tblAssignedConstructionTypes
ON tblRefConstructionTypes.ConstructionTypeID = tblAssignedConstructionTypes.ConstructionTypeID
)
ON tblAssignedBuildingTypes.AssignedBuildingTypeID = tblAssignedConstructionTypes.AssignedBuildingTypeID
)
LEFT JOIN
(
tblRefFireSafetyDetectMethods
INNER JOIN tblAssignedFireSafetyDetections
ON tblRefFireSafetyDetectMethods.FireSafetyDetectedID = tblAssignedFireSafetyDetections.FireSafetyDetectedID
) [q1]
ON tblAssignedBuildingTypes.AssignedBuildingTypeID = q1.AssignedBuildingTypeID
WHERE (((qryAllPropertyIDs.Status)="Active"));