I want to use the fact that on two tables t1
and t2
I can make an inner join with on t1.colum1>t2.colum2
to calculate the maximum drawdown of a return vector. The problem is that an inner join is only possible with two stored databases or tables and I wanted to do it selecting just a part of the tables.
Is there any other possibility, I am totally new to sql and I can't find any other option?
Thank you
edit
before manipulating my inner join to be able to calculate my maximum drawdown I have to be able to make this inner join on a selection on the tables and not the tables themselves. So I followed Mark's advice but I am still getting an error. Here is my query:
select *
from (select * from bars where rownum <= 10 as x)as tab1
inner join (select * from bars where rownum <= 10 as y) as tab2
on tab1.x=tab2.y
The error is ora-00907 missing right parenthesis
- additional information extracted from OP's message published as answer to this post. *
(inner) join is not limited to whole tables.