I have a table with the columns City and ZoneCode. I have a dropdown list where I can select just one City or all. And another dropdownlist for the ZoneCode. Basically they are filters that only filter if I select a value from the dropdown lists.
Is there any recommended technique to do this?
edit: this table is only an example.
Thank you
If you have a composite index on
(City, ZoneCode):If you don’t have one and cannot create it:
The first query assumes that you cannot filter on
ZoneCodewithout specifying theCity.