I have a table for cars with these columns:
ID
BrandID
ModelID
ColorID
ProductionYear
Price
IsSecondHand
.
.
.
Brands, Models, Colors and... have their own tables.
Users have wide filtering options, in the other words all filter are optional, and user may or may not choose a brand, model, color, etc. can choose a productionyear range, price range. and even some filters have more than one value, for example user may choose to see cars that are red or white. or may choose to filter several models.
I want to write a stored procedure to return the results and I want to find a way to write an easier code with good performance. I don't want to use 1000 if clauses in my procedure.
Any ideas?