[英]How to alter column in varchar datatype to timestamp? The data in the column are in the format 'yyyy-mm-ddThh:mm:ss
Given the below sample data, what will be the alter column clause in Redshift to change it to timestamp?给定以下示例数据,Redshift 中将其更改为时间戳的 alter column 子句是什么? currently it is in varchar
目前它在varchar中
timestamp![]() |
---|
2021-11-23T13:39:54+00:00 ![]() |
2021-11-23T14:16:25+00:00 ![]() |
Try this:尝试这个:
cast(column_name as timestamp)
You can read about it here:你可以在这里读到它:
https://devdocs.io/postgresql~9.4/sql-expressions#SQL-SYNTAX-TYPE-CASTS https://devdocs.io/postgresql~9.4/sql-expressions#SQL-SYNTAX-TYPE-CASTS
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.