ORA-01427- Single row subquery returns more then 1 row
I have following query which is giving me the error ORA-01427- Single row subquery returns more then 1 row. When I omit the bold condition in where clause i get the data without any error but when i add that condition i am getting above error. Any help Please.
SELECT
B.PTD
,b.LBS
FROM
(
SELECT A.SEGMENT2,
A.LOBS LBS,
A.PERIOD_NAME,
A.PERIOD_YEAR,
NVL(SUM(A.ACCOUNTED_DR), 0) - NVL(SUM(A.ACCOUNTED_CR), 0) PTD
FROM (SELECT C.SEGMENT2,
DECODE((select cc.segment7
from xla_ae_lines l, gl_code_combinations cc,xla_ae_headers h