With the exception of dynamic sql, you will need to specify each of the column names. But you can get a little syntax shortcut and only list the constant once:
SELECT * FROM table WHERE 'xyz' IN (akey1, bkey2, ckey3)
With dynamic sql, you still have to issue the same query ... but you can at least use string tools to create it first, and if you want to use a wildcard, you can look in the information_schema.columns view for Find them. However, this includes opening and repeating the cursor or returning the column data to the client, any of which involves more work than just listing the column names in the original query. We hope you know your database, at least before you start asking questions.
source share