年度博客排行
-
第1名
青否云后端云 -
第2名
zw7534313 -
第3名
大家都说我很棒 - liyihz2008
- wy_19921005
- gengyun12
- hbxflihua
- e_e
- luxurioust
- dbagirl
- zysnba
- Alsmile
- robotmen
- gaozzsoft
- jywhltj
- cpongo1
- leslie26
- qepwqnp
- zhangdaiscott
- 解宜然
- cuityang
- sichunli_030
- gashero
- fantaxy025025
- 淡看人生
- ranbuijj
- gdpglc
- ssydxa219
- wallimn
- vipbooks
- hanbaohong
- jickcai
- johnsmith9th
- javashop
- appalese
- gaojingsong
- weiyides
- zhangyi0618
- java-007
- AVI
- laiyangdeli
- lyongq04
- xpenxpen
- liunancun
- 龙哥IT
- conkeyn
- nychen2000
- lyndon.lin
- panshunchang
- ouanui
最新文章列表
mysql相似于oracle的to_char() to_date()方法
文章出自:http://blog.sina.com.cn/s/blog_5529c8260101djzg.html
mysql日期和字符相互转换方法
date_format(date,'%Y-%m-%d') -------------->oracle中的to_char();
str_to_date(date,'%Y-%m-%d') -------------- ...
oracle 日期比较
案例1
select To_Date('19-01-01','dd/mm/yy') from dual
where to_date(to_char(sysdate,'yyyy-mm-dd'),'yyyy-mm-dd')
<to_date('2014-01-05','yyyy-mm-dd')
可以看出 to_date和to_char都可以把给的日期或时间转发为相应的格式
to_date:把字 ...
to_date转成字符串时ORA-01843 not a valid month 问题分析
(注,本文三度易稿) 在开发Oracle SQL或PL/SQL程序过程中,我们常常遇到将字符串类型转换成DATE类型的需求。我们会使用to_date来实现这个转换需求。但有时候这种转换会出错,报ORA-01843:not a valid month。有时候这种转换在开发系统上测试时是正常的,部署到生产环境时却出这种错误。
例如,我们需要将字符串类型的字符串'19-JUN-01'转换为时间类型的 ...
SQL常用 to_char(),to_number
1.取得当前日期是本月的第几周
SQL> select to_char(sysdate,'YYYYMMDD W HH24:MI:SS') from dual;
TO_CHAR(SYSDATE,'YY
-------------------
20030327 4 18:16:09
SQL> select to_char(sysdate,'W') from dual;
T
-
4
2: ...