当前位置: 代码迷 >> Oracle开发 >> oracle中on跟where的区别
  详细解决方案

oracle中on跟where的区别

热度:32   发布时间:2016-04-24 07:01:16.0
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是过滤条件用的。
  相关解决方案