2012-11-08 116 views
0

什麼在世界上可能是錯誤的,語法看起來很好:無效語法CTE

With photos(PhotoID, MemberID) as 
(
    select photoID, 
      memberID 
    from MemberPhotos 
) 
select PhotoID, MemberID from photos 
+3

什麼是錯誤?哪一行是錯誤? –

回答

3

如果CTE從另一個查詢如下,你應該WITH關鍵字前加上一個semi-colon

;With photos(PhotoID, MemberID) as 
(
    select photoID, 
      memberID 
    from MemberPhotos 
) 
select PhotoID, MemberID from photos