1

你如何将这个 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
 ;
4

1 回答 1

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'
于 2013-07-18T09:45:25.547 回答