I have the view (below) working great. It is not throwing All I need to do is get one more value in there, but I am having trouble understanding what I am doing wrong!
NOTE -
field "R" is supposed to have the criteria 'sum_unit' = 'R'
& the field "C" should be coming from 'sum_unit' = 'C'
I could not get them both to come in on one line, so I put the restriction on sum_unit in the where statement, used that for the field "R". I now just want to slip in the value for "C" - I think I need an update statement? A subquery?
I tried a subquery but ended up getting multiple rows..not good.
Any ideas?
**********************************
SELECT
PLGR.PROJ_ELEM_ID,
PLGR.BID_CTGY,
' ' AS RES,
'N' AS OT,
decode (PLGR.PRD,
'10212' ,
'2002-03',
'10301' ,
'2002-04',
) AS PERIOD,
SUM_UNIT,
(nvl(PLGR.CUR_ACT ,
PLGR.PRD_ACT) ) AS R,
'' AS C
FROM
CSIOWNER.PLGR_ELK PLGR,
CSIOWNER.PELM PELM
WHERE
PLGR.PROJ_ELEM_ID = PELM.PROJ_ELEM_ID AND
PLGR.ORG_ID = PELM.ORG_ID AND
PLGR.ORG_ID = '001' AND
PELM.COST_MODE = 'D' AND
PLGR.BID_CTGY <> '**' AND
substr(PLGR.PROJ_ELEM_ID,1,4) = '1973' AND
PLGR.PRD = '10405' AND
PLGR.SUM_UNIT = 'R'
ORDER BY PROJ_ELEM_ID, BID_CTGY
LMC
NOTE -
field "R" is supposed to have the criteria 'sum_unit' = 'R'
& the field "C" should be coming from 'sum_unit' = 'C'
I could not get them both to come in on one line, so I put the restriction on sum_unit in the where statement, used that for the field "R". I now just want to slip in the value for "C" - I think I need an update statement? A subquery?
I tried a subquery but ended up getting multiple rows..not good.
Any ideas?
**********************************
SELECT
PLGR.PROJ_ELEM_ID,
PLGR.BID_CTGY,
' ' AS RES,
'N' AS OT,
decode (PLGR.PRD,
'10212' ,
'2002-03',
'10301' ,
'2002-04',
) AS PERIOD,
SUM_UNIT,
(nvl(PLGR.CUR_ACT ,
PLGR.PRD_ACT) ) AS R,
'' AS C
FROM
CSIOWNER.PLGR_ELK PLGR,
CSIOWNER.PELM PELM
WHERE
PLGR.PROJ_ELEM_ID = PELM.PROJ_ELEM_ID AND
PLGR.ORG_ID = PELM.ORG_ID AND
PLGR.ORG_ID = '001' AND
PELM.COST_MODE = 'D' AND
PLGR.BID_CTGY <> '**' AND
substr(PLGR.PROJ_ELEM_ID,1,4) = '1973' AND
PLGR.PRD = '10405' AND
PLGR.SUM_UNIT = 'R'
ORDER BY PROJ_ELEM_ID, BID_CTGY
LMC