【发布时间】:2016-09-27 17:01:27
【问题描述】:
您好,我有 3 个表,我想从 3 个表中提取相同的列,这是编写 Select 查询的更好方法。
select * from
(
select col1,
select id1 from testid1 where name=pnrtable1.name,
col3 from table1
union all
select coltab1,
select newid2 from testid2 where name=pnrtable2.name,
coltab3 from table2
union all
select namecol1,
select id3 from testid3 where name=pnrtable3.name,
namecol3 from table3
)
【问题讨论】:
-
您的查询甚至无法解析,您的语法错误。
-
你使用的是
MySQL还是SQL Server? -
我正在使用 Netezza
标签: mysql sql sql-server select