I have a table lnd_wkly_plan_rx_summary
and
columns pd_end_dt, nrx_cnt
containing data
PD_END_DT NRX_CNT
12/26/08 1,178.75
12/19/08 2,027.12
12/12/08 1,907.08
12/05/08 2,092.90
11/28/08 1,236.44
11/21/08 1,857.82
11/14/08 1,817.55
11/07/08 1,800.54
10/31/08 1,985.13
i need to put a join on same table lnd_wkly_plan_rx_summary
and compare data of PD_END_DT,NRX_CNT weekly
so dat i can get difference of NRX_CNT as zero
Final table will contain following columns
PD_END_DT NRX_CNT DELTA
snapshot of the table is
MKT_ID PROD_GRP_NBR CHNL_CD PERIOD_FILE_TYPE PD_END_DT NRX_CNT NRX_QTY
02601 00000020 1 W 10/12/07 2,041.64 9,706.23
02601 00000020 1 W 10/05/07 2,122.89 10,593.91
02601 00000020 1 W 09/28/07 2,072.10 10,247.32
02601 00000020 1 W 09/21/07 2,070.78 10,042.91
02601 00000020 1 W 09/14/07 2,120.01 10,493.93
02601 00000020 1 W 09/07/07 1,828.18 8,867.92
02601 00000020 1 W 08/31/07 2,294.99 11,115.15
02601 00000020 1 W 08/24/07 2,133.24 10,434.83
02601 00000020 1 W 08/17/07 2,186.42 10,739.04
CHNL_CD VARIES AS 1 OR 2 PROD_GRP_NBR 20-200 PERIOD_FILE_TYPE IS W
.........This is just first step to get to the final result............