1
爲什麼從下面的代碼中得到錯誤「關鍵字'AS'附近的語法錯誤?分配結果時,「AS @variable」附近的語法錯誤?
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
完美的感謝,你不會相信我有多長時間的代碼,有點搞亂奇怪,爲什麼這是行不通的。 – gallie
@gallie - 出於好奇,你用什麼理由接受答案? –
我的代碼現在按我希望的方式工作。這不是唯一的理由嗎? :) – gallie