I have 4 tables.
r1, r2, r3 and r4. The columns of the table are as follows:
rId | rName
I want to have, in order, a unique table - let's call it R. Obviously, R will have the following structure:
rTableName | rId | rName
I am looking for a solution, and all the more natural for me is:
- add one column to all rX
- insert this column the name of the table I'm processing
- generate SQL queries and concatenate them all
Although I definitely see how to do 1 and 3 with batch loading, editing, etc. (I should only execute it once and for all), I donβt see how to make point 2: self-service tablename to be inserted into SQL.
Do you have an idea or other way to do this to solve my problem?
Note. Actually there are 250 + rX tables. That is why I cannot do it manually. Note2: Exactly, this is with MySQL.