ODPS 日期类型转字符串函数 - to_char 使用指南
ODPS 中可以使用 to_char 函数将日期类型转换成字符串类型,语法如下:
to_char(date_column,'format')
其中,date_column 为要转换的日期列名,format 为转换的格式规则,具体的转换规则可以参考 Oracle 官方文档。
例如,将 date_column 转换为格式为 'yyyy-MM-dd' 的字符串,可以使用以下语句:
SELECT to_char(date_column,'yyyy-MM-dd') FROM table_name;
原文地址: https://www.cveoy.top/t/topic/oibl 著作权归作者所有。请勿转载和采集!