[英]SQL Inner join on select statements
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! 并且我收到以下错误:ORA-00933 SQL命令未正确结束任何帮助将不胜感激,谢谢!
Just remove as
from your query: 只是删除as
您查询:
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. 否则,选择对我来说很好。
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)
just give a whitespace between ')' and 'as': 只需在')'和'as'之间添加一个空格:
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
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.