You could do
SELECT *
FROM dbo.PLANTS
where
(@Name='Fruits' and [Plant] in ('Apple', 'Lemon', 'Orange'))
If you'll want to select other things based on @Name
, you could do that:
SELECT *
FROM dbo.PLANTS
where (@Name='Fruits' and [Plant] in ('Apple', 'Lemon', 'Orange'))
or (@Name='Vegetables' and [Plant] in ('Tomato', 'Onion', 'Cucumber'))
However, it's best that you make this more explicit in the data itself and add a Catergory
column, as Aaron pointed out.