我正在尝试对联盟的结果进行选择。我正在运行Oracle 11g。我运行了以下查询,得到ORA-00933: SQL command not properly ended
我查看了很多其他帖子,这应该有效,但不适合我。任何帮助将不胜感激。
SELECT tbl.name
FROM
(
SELECT name FROM customer
UNION
SELECT name FROM vendor
) AS tbl;
答案 0 :(得分:4)
删除as
。
SELECT tbl.name
FROM
(
SELECT name FROM customer
UNION
SELECT name FROM vendor
) tbl
答案 1 :(得分:2)
Oracle不支持as
表别名。所以,只需删除它:
SELECT tbl.name
FROM (SELECT name FROM customer
UNION
SELECT name FROM vendor
) tbl;