oracle11G数据库中某列为DATE型日期,怎么能转换成number型

发布于2022-01-13 00:56:50
3个回答
admin
网友回答2022-01-13
  number类型的to_char是这么用的select to_char( 20150628 ,'9,999,999') from dual
  要实现你要的结果,必须这么写
  select to_char(to_date( '20150628' ,'yyyymmdd'),'yyyy/mm/dd') from dual
  把'2010052' 换成你字段I_Appr_Date就可以了.
  select to_char(to_date(col,'yyyy/mm/dd'),'yyyy/mm/dd') from tb
  下面是例子 :
  SQL select to_date(20100628,'yyyy/mm/dd') from dual
  2 /
  TO_DATE(201006
  28-6月 -15
  SQL select to_char(to_date(20100628,'yyyy/mm/dd'),'yyyy/mm/dd') from dual;
  TO_CHAR(TO
  2015/06/28
admin
网友回答2022-01-13
select to_number(to_char(riqi,'yyyymmddhh24miss')) as period_id from table;
ok?
admin
网友回答2022-01-13
转换规则是什么?

回到
顶部