pardeshirahul
asked on
single row subquery returns more then 1 row
/* Formatted on 11/5/2013 3:28:29 PM (QP5 v5.252.13127.32847) */
SELECT cc.concatenated_segments "GL Account",
cc.gl_account_type "Account Type",
NVL (SUM (bal.begin_balance_dr - bal.begin_balance_cr), 0)
"Begin Balance",
h.period_name "Period Name"
FROM gl_code_combinations_kfv cc,
gl_balances bal,
apps.gl_je_headers h,
apps.gl_je_lines l
WHERE cc.code_combination_id = bal.code_combination_id
AND h.period_name = 'JAN-13'
AND h.je_header_id = l.je_header_id
AND l.ledger_id = 2947
AND cc.segment2 = NVL ('I00G15', cc.segment2)
and (select trim(substr(fftl.DESCRIPTI ON, 1,3))
from fnd_flex_Values ffv,
fnd_flex_values_vl ffvv,
fnd_flex_values_tl fftl,
fnd_flex_value_sets ffvs
where ffv.FLEX_VALUE_ID = ffvv.FLEX_VALUE_ID
and ffvv.FLEX_VALUE_ID =fftl.flex_value_id
and ffvs.FLEX_VALUE_SET_NAME ='CCL_ACCOUNTS'
and ffvv.flex_value=cc.segment 4
and language='TR')=102
AND cc.code_combination_id = l.code_combination_id
GROUP BY cc.concatenated_segments, cc.gl_account_type, h.period_name
ORDER BY cc.concatenated_segments
i dont know how to write the query
SELECT cc.concatenated_segments "GL Account",
cc.gl_account_type "Account Type",
NVL (SUM (bal.begin_balance_dr - bal.begin_balance_cr), 0)
"Begin Balance",
h.period_name "Period Name"
FROM gl_code_combinations_kfv cc,
gl_balances bal,
apps.gl_je_headers h,
apps.gl_je_lines l
WHERE cc.code_combination_id = bal.code_combination_id
AND h.period_name = 'JAN-13'
AND h.je_header_id = l.je_header_id
AND l.ledger_id = 2947
AND cc.segment2 = NVL ('I00G15', cc.segment2)
and (select trim(substr(fftl.DESCRIPTI
from fnd_flex_Values ffv,
fnd_flex_values_vl ffvv,
fnd_flex_values_tl fftl,
fnd_flex_value_sets ffvs
where ffv.FLEX_VALUE_ID = ffvv.FLEX_VALUE_ID
and ffvv.FLEX_VALUE_ID =fftl.flex_value_id
and ffvs.FLEX_VALUE_SET_NAME ='CCL_ACCOUNTS'
and ffvv.flex_value=cc.segment
and language='TR')=102
AND cc.code_combination_id = l.code_combination_id
GROUP BY cc.concatenated_segments, cc.gl_account_type, h.period_name
ORDER BY cc.concatenated_segments
i dont know how to write the query
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER