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

4

1 回答 1

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

拉吉

于 2013-08-26T10:26:13.730 回答