这是我的查询:
select * from (
select Name, Address
from table1
UNION ALL
select Name, Address
from table2
) D
执行此查询时出现错误:
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
尝试这个
关于sql - 与联合所有SQL查询获取错误 'Column specified multiple times',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31137239/