outer apply
(
isnull(
(select top 1
sea.Daily,
sea.SeasonId
from Season as sea
where sea.propertyId = prop.PropertyId and FromDate < @FromDate and ToDate > @ToDate
),
(select top 1 sea.Daily,
sea.SeasonId
from Season as sea where sea.propertyId = prop.PropertyId)
)
) as pri
写入错误')'附近的语法不正确。关键字'as'附近的语法不正确。
答案 0 :(得分:1)
缺少“选择”??
outer apply
(
SELECT isnull(
(select top 1
sea.Daily,
sea.SeasonId
from Season as sea
where sea.propertyId = prop.PropertyId and FromDate < @FromDate and ToDate > @ToDate
),
(select top 1 sea.Daily,
sea.SeasonId
from Season as sea where sea.propertyId = prop.PropertyId)
)
) as pri
拉吉