set @q= CONCAT('SELECT columns.column_name
from table inner
join information_schema.columns
on columns.table_schema = "dbname"
and columns.table_name = "table"
and ((',
(SELECT GROUP_CONCAT(CONCAT('columns.column_name="',column_name,'"',' and table.',column_name,' = "value','"') SEPARATOR ' OR ')
FROM INFORMATION_SCHEMA.COLUMNS
WHERE table_name = 'table'),
'))');
prepare query from @q;
execute query;
Dit werkt zeker..
Pff!
Fiddle:http://sqlfiddle.com/#!2/9420c/2/2
PS:Vervang table
met je tabelnaam ,dbname
met uw db-naam en value
met jouw waarde