-- [ Picked text/plain from multipart/alternative ] If I'm reading your question right, it seems to me that the user's query would read something like SELECT * FROM food WHERE color != 'red'; the column names would be stored as variables, of course hth, toad