我无法弄清楚我的UNION查询问题

时间:2018-07-17 14:43:13

标签: sql ms-access syntax

这就是我正在使用的:

SELECT [Contact ID], [Contact], [Zip Code], [County]
FROM [Training WLS]

UNION

SELECT [Contact ID], [Contact], [Zip Code], [County]
FROM [WLS TA]

这是错误:

  

查询表达式“联系人ID”中的语法错误(缺少运算符)。

1 个答案:

答案 0 :(得分:0)

我的猜测?引擎不够智能,无法合并名称中带有空格的列。

请改用此方法,看看是否可行:

SELECT [Contact ID] as ContactID, [Contact], [Zip Code] as ZipCode, [County]
FROM [Training WLS]

UNION

SELECT [Contact ID] as ContactID, [Contact], [Zip Code] as ZipCode, [County]
FROM [WLS TA]