用cast就可,但要填适当的类型,示例:
select cast(11 as unsigned int) /*整型*/
select cast(11 as decimal(10,2)) /*浮点型*/
oracle
to_char(sysdate,'yyyy-mm-dd')-->date_format(sysdate(),'%Y-%m-%d');
to_date(sysdate,'yyyy-mm-dd')-->STR_TO_DATE(sysdate(),'%Y-%m-%d');
1.oracle
------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------
3.MysqL
+------------------------------------------------+
| date_format('2008-08-08 22:23:00','%W %M %Y') |
+------------------------------------------------+
| Friday August 2008 |
+------------------------------------------------+
MysqL> select date_format('2008-08-08 22:23:01','%Y%m%d%H%i%s');
+----------------------------------------------------+
| date_format('2008-08-08 22:23:01','%Y%m%d%H%i%s') |
+----------------------------------------------------+
| 20080808222301 |
+----------------------------------------------------+
MysqL> select time_format('22:23:01','%H.%i.%s');
+-------------------------------------+
| time_format('22:23:01','%H.%i.%s') |
+-------------------------------------+
| 22.23.01 |
+-------------------------------------+
MysqL 日期、时间转换函数:date_format(date,format) 能够把一个日期/时间转换成各种各样的字符串格式。它是 str_to_date(str,format) 函数的 一个逆转换。
4)
TO_NUMBER用cast就可,示例: select cast(11 as unsigned int) select cast(11 as decimal(10,2))