siliconpi siliconpi - 1 year ago 69
SQL Question

MYSQL query for searching through ALL the fields?

As dumb as it sounds, is there a way to do something like this:

select row_id from mytable where * like '%searched_text%';

By * here I mean "all the fields" in the table, instead of me specifying them one by one...

Answer Source

It is not possible with one query.

However when you do:

DESCRIBE table_name;

you get the field names which you can generate the query from. May be useful.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download