Query filter design for string field
- by Midhat
A field in my table can have arbitrary strings. On the UI, there is a drop down having options like
All, Value1, Value2
And the results were filtered by the selected option value. So far this is easy and adding new filters to the UI is not a problem. Needs no changes in my stored procedure. Now I want to have an "Others" option here as well, which will return rows not having the column value as Value1 or Value2.
Apparently this will require a "not in" operator in my query, and will make maintenance difficult, as the list of values is likely to change
Any suggestions, design tips?