请有人告诉我如何将数据集绑定到使用此过滤条件的参数(@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')
)
)