首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > oracle >

oracle中on跟where的区别

2013-06-25 
oracle中on和where的区别请问高手,oracle中on和where有什么区别啊,如select * fromtest_reportr right joi

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

热点排行