سؤال

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