Query filter design for string field
        Posted  
        
            by Midhat
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Midhat
        
        
        
        Published on 2010-06-14T09:16:39Z
        Indexed on 
            2010/06/14
            9:22 UTC
        
        
        Read the original article
        Hit count: 265
        
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?
© Stack Overflow or respective owner