I am trying to make an inner join on a select statement like this:
select * from (select* from bars where rownum <= 10 )as tab1 inner join (select * from bars where rownum <= 10 )as tab2 on tab1.close=tab2.close
and I get the following error: ORA-00933 SQL command not properly ended Any help would be appreciated, thank you!
To combine two or more SELECT statements to form a single result table, use the set operators: UNION, EXCEPT or INTERSECT.
With INNER JOIN your Sub-Query will be execute only once and its records may gets stored internally in tempdb worktable on complex operations, then JOINed with the 1st table. With APPLY clause, the Sub-Query will be executed for every row in the 1st table.
To use the WHERE clause to perform the same join as you perform using the INNER JOIN syntax, enter both the join condition and the additional selection condition in the WHERE clause. The tables to be joined are listed in the FROM clause, separated by commas. This query returns the same output as the previous example.
Just remove as
from your query:
select * from (select* from bars where rownum <= 10 ) tab1 inner join (select * from bars where rownum <= 10 ) tab2 on tab1.close=tab2.close
I believe the error comes from you needing a semicolon to end the statement. The select looks fine to me otherwise.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With