从Oracle转换为PostgreSQL,有很多SQL可以从Oracle的联接语法“(+)”转换为标准联接语法。有自动的方法-工具-来做到这一点吗?除此以外,进行此类转换时是否有经验法则?
例如,将其转换为
SELECT
request.requestId
FROM
request,
incident,
changeRequest
WHERE
incident.requestId = request.requestId AND
changeRequest.requestId = request.requestId(+)
/
对此
SELECT
request.requestId
FROM
request
INNER JOIN incident ON incident.requestId = request.requestId
LEFT OUTER JOIN changeRequest ON changeRequest.requestId = request.requestId;
答案 0 :(得分:1)
这是一种算法:
如果x.a = y.b(+)
子句中有WHERE
,请转动
FROM x, y
到
FROM x LEFT JOIN y ON x.a = y.b
类似于左侧的(+)
和RIGHT JOIN
。