Generate request for all databases and tables

SELECT TABLE_SCHEMA, table_name, column_name, concat(
 'select * FROM ', c.TABLE_SCHEMA,'.',c.table_name,' where game_id in (1,5);'
)
FROM information_schema.columns AS c
WHERE column_name ='game_id';

Leave a Reply

Your email address will not be published. Required fields are marked *