I have a Pl/SQL query that pull all records from the 3 tables. That is good. Now I want pull last 24 updated records from 2 table (tbl_constit, tbl_email).
See below actual query
SELECT DISTINCT c.constit_id AS constitid,
REPLACE (c.in_labelname, 'None', '') AS fullname,
c.firstname AS firstname, c.lastname AS lastname,
c.indiv_title AS title, e.e_addr AS email,
'InActive' AS status
FROM tbl_constit cn, tbl_email e,tbl_catcod s
WHERE c.constit_id = e.constit_id
AND c.constit_id = s.constit_id(+)
AND e.e_type = 'EMAIL'
AND e.e_default = '1'
AND s.cat_code IN ('SPEMU', 'SPENM')
ORDER BY c.constit_id;
tables tbl_constit cn, tbl_email e has ‘CHGD_DT’ field.
This date field change when record is updated. Now How can I pull last 24 updated records from tbl_constit cn or tbl_email by using ‘CHGD_DT’ field?
Change can happen any one of two tables.
This will show all rows where either cn or e was updated in the last 24 hours, if you want to show rows where both where updated, replace the inner OR with an AND.