0
請有人告訴我如何將數據集綁定到使用此過濾條件的參數(@Productcategory和@PriceRange),或者有另一種方法來寫入此過濾器。將數據綁定到參數
感謝艾瑪
WHERE ((ProductCategory.Name = @ProductCategory OR
(@ProductCategory = 'All Bike Related' AND
ProductCategory.Name IN ('Bikes', 'Components')) OR
(@ProductCategory ='All')
) AND
((@PriceRange = 'Less than 50' AND ListPrice < 50) OR
(@PriceRange ='50 to 99' AND ListPrice BETWEEN 50 AND 99) OR
(@PriceRange ='100 to 499' AND ListPrice BETWEEN 100 AND 499) OR
(@PriceRange ='500 and higher 'AND ListPrice >=500) OR
(@PriceRange = 'All')
)
)