wq573983087 发表于 2016-9-23 17:17:01

DBLink查询语句的异常报错

本帖最后由 wq573983087 于 2016-9-23 17:46 编辑

问题描述:
有五条sql分别如下:
sql1: select max(id) from (select t1.id from t1 left join t2 on t1.col = t2.col and (t2.name = 'A' or t2.name = 'B') group by t1.id )
sql2: select id from (select t1.id from t1 left join t2 on t1.col = t2.col and (t2.name = 'A' or t2.name = 'B') group by t1.id)
sql3: select max(id) from (select t1.id from t1 left join t2 on t1.col = t2.col and (t2.name = 'A') group by t1.id)
sql4: select max(id) from (select t1.id from t1 left join t2 on t1.col = t2.col and (t2.name = 'A' or t2.name = 'B'))
sql5: select max(id) from (select t1.id from t1 inner join t2 on t1.col = t2.col and (t2.name = 'A' or t2.name = 'B') group by t1.id )
其中t1,t2表是dblink远程连接的表

执行结果sql2,sql3,sql4正确执行,sql1报ora-00907: missing right parenthesis ora-02063: preceding line from DBLink_name

oracle 版本都为ora10G

我们同事说在测试库测试过这条sql了,是没有问题的,但是在服务器出错了

多谢大家啦
页: [1]
查看完整版本: DBLink查询语句的异常报错