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'.

有帮助吗?

解决方案

Missing "Select"??

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

Raj

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top