문제

I have last_update_date column defined as DATE field

I want to get time in milliseconds.

Currently I have:

TO_CHAR(last_update_date,'YYYY-DD-MM hh:mi:ss am')

But I want to get milliseconds as well.

I googled a bit and think DATE fields will not have milliseconds. only TIMESTAMP fields will.

Is there any way to get milliseconds? I do not have option to change data type for the field.

올바른 솔루션이 없습니다

다른 팁

를 사용하십시오

if (preg_match('#\.(\.)?/#', $path, $match)) echo "Error";
.

../ 또는 ./을 확인 해야하는 경우에만이 기능을 사용해야합니다

if (preg_match('#^\.(\.)?/#', $path, $match)) echo "Error";
.

As RC says, the DATE type only supports a granularity down to the second.

If converting to TIMESTAMP is truly not an option then how about the addition of another numerical column that just holds the milliseconds?

This option would be more cumbersome to deal with than a TIMESTAMP column but it could be workable if converting the type is not possible.

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top