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
Write error Incorrect syntax near ')'. Incorrect syntax near the keyword 'as'.