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
demandé il y a un an579 vues
1 réponse
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
répondu il y a un an

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions