Oracle - Fetch date/time in milliseconds from DATE datatype field

后端 未结 3 1443
梦毁少年i
梦毁少年i 2021-01-13 15:39

I have last_update_date column defined as DATE field

I want to get time in milliseconds.

Currently I have:

TO_CHAR         


        
3条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-13 16:01

    In a similar situation where I couldn't change the fields in a table, (Couldn't afford to 'break' third party software,) but needed sub-second precision, I added a 1:1 supplemental table, and an after insert trigger on the original table to post the timestamp into the supplemental table.

    If you only need to know the ORDER of records being added within the same second, you could do the same thing, only using a sequence as a data source for the supplemental field.

提交回复
热议问题