This is my query:
select * from (
select Name, Address
from table1
UNION ALL
select Name, Address
from table2
) D
When executing this query getting error:
The column 'Name' was specified multiple times for 'D'.
This is my query:
select * from (
select Name, Address
from table1
UNION ALL
select Name, Address
from table2
) D
When executing this query getting error:
The column 'Name' was specified multiple times for 'D'.
select * from (
select t1.Name as t1_Name, t1_Address as t1_Address
from table t1
UNION ALL
select t2.Name as t2_Name, t2_Address as t2_Address
from table t2
) D
try this
Use alias names
select * from (
select t1.Name, t1.Address
from table1 as t1
UNION ALL
select t2.Name, t2.Address
from table2 as t2
) D