How to define date variable and assign that variable from the table in oracle?
I tried below
DEFINE EXTRACTION_DATE = SELECT DATA_EXTRACTION_DATE FROM tbl1
SELECT PA.PERSON_ID,A.PERIOD_END_DATE,PA.OPT_OUT_OF_PLAN_DATE,A.TERMINATION_DATE,
CASE WHEN A.PERIOD_END_DATE <= ADD_MONTHS(TRUNC(&EXTRACTION_DATE), -3) THEN 'Y' ELSE 'N' END
FROM
tbl2
it throwing invalid statement error.
its not duplicate of another. Because I need to get variable from the table not by static variable.