为什么我从以下代码中收到错误“关键字 'AS' 附近的语法不正确”?
DECLARE @FirstHole INTEGER
SELECT MIN(HoleId) FROM dbo.Holes WHERE CourseId = (
SELECT MAX(dbo.Holes.CourseId) FROM dbo.Registration
LEFT JOIN dbo.Competitions ON dbo.Registration.CompetitionId = dbo.Competitions.CompetitionId
LEFT JOIN dbo.Holes ON dbo.Competitions.CourseId = dbo.Holes.CourseId WHERE RegistrationId = 102
) AND dbo.Holes.MarkerId = 2 AS @FirstHole