I am going to do cdc process. use the Timestamp. one table to store the last_upload time,and current_upload time.
just like this
SELECT
LAST_LOAD_TIME
, CURRENT_LOAD_TIME
FROM CDC_TIME_GW

then the two variables flow to a next table .

SELECT
CAI_ID,
CST_ID,
MAX(DECODE(MGI_VALUE_TYPE,2,MGI_READING,0)) AS a,
MAX(DECODE(MGI_VALUE_TYPE,4,MGI_READING,0)) AS b,
MAX(DECODE(MGI_VALUE_TYPE,5,MGI_READING,0)) AS c,
MAX(DECODE(MGI_VALUE_TYPE,6,MGI_READING,0)) AS d,
MAX(DECODE(MGI_VALUE_TYPE,7,MGI_READING,0)) AS e,
MAX(DECODE(MGI_VALUE_TYPE,8,MGI_READING,0)) AS f
FROM M_GW_INTERVAL
WHERE MGI_TS>? AND MGI_TS<?
group by CAI_ID,CST_ID
it comes out a promble: the variables can not be identified.

but if I use :
SELECT
CAI_ID,
CST_ID,
FROM M_GW_INTERVAL
WHERE MGI_TS>? AND MGI_TS<?

there is no problem.
can someone help me?