I need to combine two columns into one returning table from information_schema
.
So, I have multiple tables with fields. In every table there are some administrative field ( like, id, lastmodify, etc.) and others ( what I need ) starting with 'F_'.
SELECT TABLE_NAME, COLUMN_NAME FROM information_schema.columns WHERE TABLE_SCHEMA = "wyro" AND COLUMN_NAME LIKE "F_%" AND TABLE_NAME LIKE "D_%"
Everything is fine, if there is field like 'F_%' but in case these fields are missing, the table is not in the result of the query. I tried with several way using left / right join but having it on the same table does not bring to much result.
I need an output like:
| TABLE_NAME | COLUMN_NAME |
| D_blabla | F_blabla |
| D_blabla2 | F_blabla2 |
| D_blabla3 | |
| D_blabla4 | F_blabla |