读书人

oracle中on跟where的区别

发布时间: 2013-06-25 23:45:42 作者: rapoo

oracle中on和where的区别
请问高手,oracle中on和where有什么区别啊,
如select * from test_report r right join test_code c on c.type='StoppageType'; 正确通过
当把on换成where时:
select * from test_report r right join test_code c wherec.type='StoppageType'; oracle居然报ORA:00905-缺少关键字,请问是什么原因啊?
[解决办法]
你用right join 后必须用on去连接俩表的共同部分,如果要写过滤条件,在后面写where就行
写过几次你就明白了
[解决办法]
少了ON关键字
一定要写WHERE
那就
select * from test_report r
right join
test_code c
ON 1=1 wherec.type='StoppageType';
[解决办法]
on 是表关联用的,where是过滤条件用的。

读书人网 >oracle

热点推荐