首页 > 代码库 > postgresql 下的三表连查

postgresql 下的三表连查

SELECT corp_id,appid, login_name ,app_name,CAST(CAST(SUM(pay_fee) AS FLOAT)/100 AS DEC(10,2)) pay_fee ,report_date

FROM (pay_order INNER JOIN pay_app ON pay_order.appid = pay_app."id" )

INNER JOIN pay_corp on pay_app.corp_id =pay_corp."id"


GROUP BY corp_id,appid,report_date,login_name,app_name

ORDER BY report_date desc

postgresql 下的三表连查