===이런 ROWDATA를 가지고서=====
ECO_CD TERM TRD_DT AMOUNT
14.08.001.014.006 D 20030602 10326
14.08.001.014.006 D 20030603 10295
14.08.001.014.006 D 20030604 10299
14.08.001.014.006 D 20030605 10314
14.08.001.014.006 D 20030606 10361
14.08.001.014.006 D 20030609 10322
..........................................................................
=====================================이러한 쿼리로 ========================
SELECT ECO_CD,
TERM,
TRD_DT,
AMOUNT,
LAG(AMOUNT) OVER(PARTITION BY ECO_CD ORDER BY TRD_DT) AMOUNT_PDAY,
ㅡㅡ> DECODE(TRD_DT, TO_CHAR(ADD_MONTHS(TO_DATE(TRD_DT, ’yyyymmdd’), -1), ’yyyymmdd’), AMOUNT) AMOUNT_PMON <--------------
FROM FNE_ECO_DATA
WHERE ECO_CD = ’14.08.001.014.006’
요런쿼리인데용 --> <--- 요부분에 trd_dt가 캐릭터형인데 데이트타입으로 바꺼서 한달전날짜를 다시 캐릭터형으로해서 그떄의 amount값을 가져오려고 하는데요 . 자꾸 결과가 amount_pmon값이 안나오네요
==========================amount_pmon
ECO_CD TERM TRD_DT AMOUNT AMOUNT_PDAY AMOUNT_PMON
14.08.001.014.006 D 20030602 10326
14.08.001.014.006 D 20030603 10295 10326
14.08.001.014.006 D 20030604 10299 10295
14.08.001.014.006 D 20030605 10314 10299
==================제가 무엇을 놓치고 있나요? 고수님들 ㅠㅠ