Redshift Timestamp Trailing Zeros

0

Enter image description here Can anybody knows why the zeros at timestamp (eg. 2022-11-08 07:50:08.100 to 2022-11-08 07:50:08.10) are truncated by Redshift automatically? Please refer to my screenshot for details.

Ren
gefragt vor einem Jahr579 Aufrufe
1 Antwort
0

The timestamp is stored in Redshift typically would not loose the precision. Depending the tool you use to display the results of the SQL data, the formatting may be showing 2 decimal places as default unless you have more than 2 non zero decimal places.

Try this to display 3 or 6 digits:

select id,created_dt,
to_char(created_dt, 'HH24:MI:SS') as seconds,
to_char(created_dt, 'HH24:MI:SS.MS') as milliseconds,
to_char(created_dt, 'HH24:MI:SS:US') as microseconds;
profile pictureAWS
beantwortet vor einem Jahr

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen