- 最后登录
- 2016-11-4
- 在线时间
- 2 小时
- 威望
- 0
- 金钱
- 10
- 注册时间
- 2016-9-23
- 阅读权限
- 10
- 帖子
- 1
- 精华
- 0
- 积分
- 0
- UID
- 2484
|
1#
发表于 2016-9-23 17:17:01
|
查看: 2150 |
回复: 0
本帖最后由 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了,是没有问题的,但是在服务器出错了
多谢大家啦 |
|