Oracle日期函数:
select sysdate from dual; 从伪表查系统时间,以默认格式输出。
sysdate+(5/24/60/60) 在系统时间基础上延迟5秒
sysdate+5/24/60 在系统时间基础上延迟5分钟
sysdate+5/24 在系统时间基础上延迟5小时
sysdate+5 在系统时间基础上延迟5天
所以日期计算默认单位是天
round (sysdate,’day’) 不是四除五入了,是过了中午留下,不过的略掉
格式转换函数:
to_char显示日期:
从数字转化为char to_char(date,'格式')
从日期转化为char to_char(date, 'fmt' )
select to_char(sysdate, 'yyyy mm dd hh24:mi:ss') from dual;
select to_char(sysdate, 'fmyyyy mm dd hh24:mi:ss') from dual;
查出三月分入职的员工:
select first_name,start_date from s_emp where to_char(start_date,'mm')='03';
to_date表达日期:
字符转日期
select to_date('2000 11 20', 'yyyy mm dd ') from dual;
select round(to_date('10-OCT-06' ,'dd-mon-RR') ) from dual;
to_number
字符转数字
select to_number('10') from dual ;
函数、表达式、隐式数据类型转换会导致索引用不上,where条件后面只能放单行函数,它起了一个过滤的的作用。
相关文档:
oracle表空间操作详解
1
2
3作者: 来源: 更新日期:2006-01-04
5
6
7建立表空间
8
9CREATE TABLESPACE data01
10DATAFILE '/ora ......
select 'create sequence '||sequence_name||
' minvalue '||min_value||
' maxvalue '||max_value||
' start with '||last_number||
&n ......
大家好,我在http://download.csdn.net/source/836323上发的帖子,确实只是个demo,其题库内容见下文,此为最新题库的一部分,正式版题库是175题。需要正式版本的朋友,可以直接联系我或者到www.certinside.cn/1z0-051 上面看看,我们和testinside是一家的,需要的话我可以给你打个折,价格再议。我的QQ:390970748 ......
Oracle主键自动增长
这几天搞Oracle,想让表的主键实现自动增长,查网络实现如下:
create table simon_example
(
id number(4) not null primary key,
name varchar2(25)
)
-- 建立序列:
-- Create sequence
create sequence SIMON_SEQUENCE &nb ......
记得以前上OCP课程的时候那个老师教我们使用PROFILE来限制用户的一些操作,那个时候估计是老师偷懒吧,所有实验都是通过OEM的形式来操作,根本不会涉及到命令行。
平时在学习ORACLE的过程中好像也很少碰到关于PROFILE的问题,今天逛一个朋友的BLOG的时候发现这篇文章,觉得挺好的,内容不多,简洁明了,好歹也算是个命令行 ......