SELECT *
FROM Orders
INNER JOIN (select * from customers) as t
ON Orders.CustomerID=t.CustomerID;
When same query try to execute in mysql it return correct response. but in the case of oracle its returning missing keyword exception.
SELECT *
FROM Orders
INNER JOIN (select * from customers) as t
ON Orders.CustomerID=t.CustomerID;
When same query try to execute in mysql it return correct response. but in the case of oracle its returning missing keyword exception.
Remove the AS
keyword. In Oracle, you only need it for column alias and not for table alias.
Also, the in-line view is not required, you could simply use the table_name customers
.
Avoid using *
in production systems. Use required columns in the SELECT list with proper aliasing if you have similar columns.
SELECT o.column_list, t.column_list FROM Orders o INNER JOIN customers t ON o.CustomerID = t.CustomerID;
Oracle SELECT grammar doesn't allow 'AS' keyword before inline view alias, so
SELECT * FROM Orders INNER JOIN (select * from customers) t ON Orders.CustomerID=t.CustomerID;
And instead of (select * from customers) t you can just use customers t.