时间:2021-07-01 10:21:17 帮助过:3人阅读
CHAR[(N)] 字符型
DATE 日期型
DATETIME 日期和时间型
DECIMAL float型
SIGNED int
TIME 时间型
例如表table1
date
2015-11-03 15:31:26
select cast(date as signed) as date from table1;
结果如下:
date
20151103153126
select cast(date as char) as date from table1;
结果如下:
date
2015-11-03 15:31:26
select cast(date as datetime) as date from table1;
结果如下:
date
2015-11-03 15:31:26
select cast(date as date) as date from table1;
结果如下:
date
2015-11-03
select cast(date as time) as date from table1;
结果如下:
date
15:31:26
这里date对应日期,time对应时间
阿里云-maxcompute---sql语法
标签:sign 语法 table com 结果 sql语法 阿里 -- time