Reputation: 592
I am trying to do a select on the result of a union. I am running Oracle 11g. I ran the following query and I get ORA-00933: SQL command not properly ended
I looked at a lot of other posts and this should work, however it doesn't for me. Any help will be appreciated.
SELECT tbl.name
FROM
(
SELECT name FROM customer
UNION
SELECT name FROM vendor
) AS tbl;
Upvotes: 1
Views: 4081
Reputation: 1269463
Oracle doesn't support as
for table aliases. So, just remove it:
SELECT tbl.name
FROM (SELECT name FROM customer
UNION
SELECT name FROM vendor
) tbl;
Upvotes: 2
Reputation: 49260
Remove as
.
SELECT tbl.name
FROM
(
SELECT name FROM customer
UNION
SELECT name FROM vendor
) tbl
Upvotes: 4