Simple table:
create table Items
(
Price money null
)
Now I need to create a stored procedure that takes one parameter of type bit @ItemsWithPriceTenDollarsOrMore , which:
- returns all elements if parameter is null
- returns all elements with a price> = 10 if parameter = 1
- returns all elements with a price <10 if parameter = 0
I find it difficult to express this filter in a single where statement (without using dynamic sql or conditional logic).
source
share