in reply to (OT) MySQL Help
The initial SQL would look like this :-
Or you could use table_info on your database handle if you don't need to limit the returned list of tables or are going to filter it in perl.SELECT table_name FROM INFORMATION_SCHEMA.TABLES WHERE table_schema = 'db_name'
The second dynamic SQL statement would look like :-
Hope it help$sql = join ' UNION ', map "SELECT ID, Name, Class, Mark, $_ table_na +me from $_", @tables;
|
|---|