如何将此Oracle sql更改为postgresql
SELECT prd.name, pkg.name, si.name
FROM service_items si, service_link sl, products prd, packages pkg, product_package_link ppl
WHERE ppl.id='3'
AND prd.id=ppl.product_id
AND pkg.id=ppl.package_id AND sl.product_package_id(+)=ppl.id AND si.id(+)=sl.service_item_id
;
答案 0 :(得分:1)
尝试
SELECT prd.name, pkg.name, si.name
FROM products prd JOIN product_package_link ppl
ON prd.id = ppl.product_id JOIN packages pkg
ON pkg.id = ppl.package_id LEFT JOIN service_link sl
ON ppl.id = sl.product_package_id LEFT JOIN service_items si
ON si.id = sl.service_item_id
WHERE ppl.id = '3'