我有一个从3个表中拉出所有记录的Pl/SQL查询。那很好。现在我想从2个表(tbl_constit,tbl_email)中取出最后24条更新的记录。最近24小时使用Oracle SQL从表中更新记录?
参见下面的实际查询
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;
表tbl_constit CN,tbl_email e的 'CHGD_DT' 字段。
记录更新时此日期字段更改。 现在我怎样才能通过使用'CHGD_DT'字段从tbl_constit cn或tbl_email中取出最后24条更新记录?
变化可能发生在两个表中的任何一个。
你是正确的感谢 – James123