SQL最新审计更改

时间:2017-06-16 05:05:29

标签: mysql

    select 

    LEFT (REPLACE(KEY_2, '&', ''), 4) PROJECT_CODE,

    CASE    WHEN LEN(REPLACE(KEY_2, '&', ''))  >4 THEN RIGHT(REPLACE(KEY_2, '&', ''), 2)    ELSE ''  END as PROJECT_PHASE,
    KEY_2,  
    FIELD_NAME,
   AUDIT_OLD_VALUE,
   AUDIT_NEW_VALUE,
   UNIQUE_RID
 FROM TBADT_AUDIT_TRAIL 

where Key_1 like 'WKSCHART'
and
Audit_Date between '2017-06-13' and '2017-06-16'

ORDER BY  PROJECT_CODE, PROJECT_PHASE, FIELD_NAME
  • 所以我需要对FIELD_NAME col进行最新的更改。例如下面,在col key_2下,3332P6; Field_Name' Submission',在我的提取日期内被修改了3次。虽然没有重复,但我只需要最新的修改,即UNIQUE_RID 47271398。可能吗?

0 个答案:

没有答案