SQL 内连接 select 语句
我试图在这样的 select 语句上进行内部联接:
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
并且出现以下错误: ORA-00933 SQL 命令未正确结束 任何帮助将不胜感激,谢谢!
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!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
只需从查询中删除
as
即可:Just remove
as
from your query:我相信错误来自于您需要一个分号来结束语句。否则,选择对我来说看起来不错。
I believe the error comes from you needing a semicolon to end the statement. The select looks fine to me otherwise.
只需在 ')' 和 'as' 之间添加一个空格即可:
just give a whitespace between ')' and 'as':