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
질문됨 일 년 전579회 조회
1개 답변
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
답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠