-2
誰かが私は、MySQLデータベースに対してこのSQLを書き換えることができます(サブクエリと外側の両方が参加している)外部結合のOracle(+)記号のMySQLの変形?
**select REPORT_PACKAGE.SUBJECT_LINE, ACTIVATION_DT, PARAM_VALUE, REPORT_URL, hasCustomerDetails,
isAccountsRolledUp FROM REPORT_PACKAGE, REPORT_PARAMETER, REPORT_DEFINITION, REPORT_PACKAGE_CONTENT,
(select param_value as hasCustomerDetails, rpt_package_id from report_parameter
where param_name = 'hasCustomerDetails') a,
(select param_value isAccountsRolledUp, rpt_package_id rid from report_parameter
where param_name = 'isAccountsRolledUp') as b
WHERE REPORT_PACKAGE.RPT_PACKAGE_ID = REPORT_PARAMETER.RPT_PACKAGE_ID
and param_name = 'rulePlanId' and
REPORT_PACKAGE_CONTENT.RPT_PACKAGE_ID = REPORT_PACKAGE.RPT_PACKAGE_ID and
REPORT_PACKAGE_CONTENT.RPT_DEF_ID = REPORT_DEFINITION.RPT_DEF_ID AND
REPORT_URL like '%AcctNbr%' and REPORT_PACKAGE.RPT_PACKAGE_ID = a.RPT_PACKAGE_ID(+)
and REPORT_PACKAGE.RPT_PACKAGE_ID = b.RPT_PACKAGE_ID(+);**
私は次のことを試してみましたし、それが仕事をdidntの:
**select repa.SUBJECT_LINE, ACTIVATION_DT, PARAM_VALUE, REPORT_URL, hasCustomerDetails,
isAccountsRolledUp FROM REPORT_PACKAGE repa
left join (select param_value as hasCustomerDetails, rpt_package_id from report_parameter
where param_name = 'hasCustomerDetails') as a
left join (select param_value as isAccountsRolledUp, rpt_package_id from report_parameter
where param_name = 'isAccountsRolledUp') as b
left join a on repa.RPT_PACKAGE_ID = a.RPT_PACKAGE_ID
left join b on repa.RPT_PACKAGE_ID = b.RPT_PACKAGE_ID
inner join REPORT_PACKAGE_CONTENT repc on repa.RPT_PACKAGE_ID = repc.RPT_PACKAGE_ID
inner join REPORT_DEFINITION rd on repc.RPT_DEF_ID = rd.RPT_DEF_ID
where REPORT_URL like '%AcctNbr%'**
-1この問題を示す最小限の例を作成してください。 –
あなたは 'a'と' b'を二度参加させようとしています。 – Wiseguy