Reputation: 1458
I need to create a MySQL View that allows me to show in a single columns all rows from different tables' columns.
For example: Table1:
-----------------
| name | desc |
-----------------
1 | name1 | desc1 |
-----------------
Table2:
-----------------
| name | desc |
-----------------
1 | name2 | desc2 |
-----------------
I would like to have a view that shows:
---------
| name |
---------
1 | name1 |
2 | name2 |
---------
Is this possible? I only see people using concat() and I don't need this..
Upvotes: 1
Views: 199
Reputation: 1269753
Do you want union
/union all
?
select name
from table1
union all
select name
from table2;
Upvotes: 2