SQL Where ANY column equals a value

mysql, sql

Solution

Use `SHOW COLUMNS` to get a list of the columns in the table and then dynamically build your query from the results.

Problem

Is it possible in MySQL to select all rows where ANY column contains a specified value? I'm trying to write a generic search function that can work without any information about a table schema.

Original source