I am wondering if it is possible to alias 2 columns from 2 separate tables to the same name.
For example i want to join an email table with a user table and admin table and let the respective ‘name’ columns be combined in the same column.
Email Table: Email ID | Email Address
User Table: Username| Email ID
Admin Table: Username| Email ID
Result:
Username | Email Address
I believe this is what you’re trying to get:
This will stack the
UserandAdmintables and thenJOINtheEmailtable.Note that if there are duplicates and you want to remove them you should use
UNIONinstead ofUNION ALL.