日期:2014-05-17  浏览次数:20762 次

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是过滤条件用的。