世界上可能出错的地方,语法看起来不错:
With photos(PhotoID, MemberID) as
(
select photoID,
memberID
from MemberPhotos
)
select PhotoID, MemberID from photos
答案 0 :(得分:3)
如果CTE
来自其他查询,则应在semi-colon
关键字之前添加WITH
。
;With photos(PhotoID, MemberID) as
(
select photoID,
memberID
from MemberPhotos
)
select PhotoID, MemberID from photos