MSSQL isnull 在外部应用中不起作用


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"附近的语法不正确。

缺少"选择"??

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

拉吉

相关内容

最新更新