易截截图软件、单文件、免安装、纯绿色、仅160KB

Oracle Date Function 讲解和事例

http://blog.csdn.net/mustbelove/archive/2007/04/17/1567836.aspx(转)
1 year=1*12 months
1 day=24
hours=24*(1*60mins)=24*60*(1*60 seconds)
1 week =7 days
注意:
黑色字体是 oracle

8i,9i都可以使用的函数,
蓝色字体是 Oracle
9i

增的部分。
 
请大家在使用时,注意版本限制。
add_months
current_date
current_timestamp
datimezone
extract(datetime)
last_day
months_between
new_time
next_day
round
SYSDATE
systimestamp
TO_DATE
trunc()
1: Add_Months
语法:
Add_Months(d,n)
函数 -- n可正可负
作用: Add_Months(d,n) 返回日期 D 加上n
月的日期
Example:
A:下个月的今天
select add_months(sysdate,1) from
dual --在月份上增加
B:上个月的今天
select add_months(sysdate,-1) from dual
--在月份上减少
C: 上个月的最后一天
select last_day(add_months(sysdate,-1)) from
dual
 
2: C
urrent_date
语法:
C
urrent_date
作用:
CURRENT_DATE 返回当前Session 时区的当前日期。
Example:
A:不特别设定 oracle
time_zone 是和系统Time_zone 一致。
select current_date,sysdate from dual
SQL> select
current_date,sysdate from dual ;
CURRENT_DATE
SYSDATE
--------------- ---------------
20051109 160535 20051109
160534
B:
ALTER SESSION SET TIME_ZONE = '-5:0';
SQL> select current_date,sysdate from
dual;
CURRENT_DATE SYSDATE
---------------
---------------
20051109 030644
20051109 160644
 
3: C
urrent_timestamp
语法:
CURRENT_TIMESTAMP
(precision)
作用:
current_timestamp
返回此session 所在时区的当前日期和时间。
数据类型是 TIMESTAMP
WITH TIME ZONE.
Example:
A:default
timestamp
SQL> select CURRENT_TIMESTAMP
from dual;
CURRENT_TIMESTAMP
------------------------------------------------------------
09-NOV-05
04.27.41.416811 PM +08:00
B: use precision
SQL> ALTER
SESSION SET TIME_ZONE ='-5:0';
Session altered.
SQL> SELECT
SESSIONTIMEZONE, CURRENT_TIMESTAMP
from DUAL
SESSIONTIMEZONE CURRENT_TIMESTAMP
--------------------
---------------------------------------
-05:00 09-NOV-0


相关文档:

oracle中如何设置登录的默认数据库

      在oracle中当我们新建了多个数据库后,再次登录时,系统默认的是最后创建的那个数据库。
      如何设置我们自己想要的默认数据库呢?
      方法很简单,我们只需在运行窗口里输入regedit,即可进入注册表编辑器,在HKEY_LOCAL_MACHI ......

Red Hat Cluster Suite集群 Oracle数据库

目录
一、概述
二、硬件平台搭建
三、Redhat As4 update2安装配置
四、Oracle 10g安装配置
五、Red Hat Cluster Suite安装配置
六、系统切换测试
七、常用命令
一、概述
黄岛市开发区财政局本次采用两台IBM X3850-8664服务器、一台DS4300盘阵,平台采用Redhat As4 update2
结合cluster suite,部署Oracle 10g数 ......

关于oracle学习,对找资料阶段的有意义

平时接触mysql较多,因为mysql在一般的小项目中够用了 开源而且免费。
很多公司需要oracle维护的,开发oracle甚至是二次开发在国内也比较少的,有甲骨文公司,谁敢和他们抢饭碗啊 哈哈 不过人家的收费蛮贵的,你如果有水平,吃点残羹的机会蛮多。 oracle的培训信息表达了市场需求。
(我在学校环境的猜想,专业人士来拍砖 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号