向Oracle表中插入规定的系统时间实操

数据库 Oracle
我们今天主要向大家介绍的是向Oracle表中插入规定的系统时间的实际操作方案,以下就是文章的具体内容的描述,望你会有所收获。

以下的文章主要介绍如何向Oracle表中插入规定的系统时间,我们是以相关操作的实际应用代码的描述,来引出向Oracle表中插入规定的系统时间的实际操作,以下就是文章的详细内容介绍,望大家借鉴。

SQL> insert into test values(2,'cba',sysdate);  
1 row created.  
SQL> select * from test;  
A B C  
1 c  
2 c  
1 a'b  
1 abc  
03-DEC-09  
2 cba 03-DEC-09  
2 cba 03-DEC-09  
7 rows selected.  
SQL> 
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.

 

另外,自己对Oracle时间日期格式的理解:

所要完成的内容就是查询2009年11月1日这天的记录,时间精确到秒,如下:

 

select * from dg_order  
where DATE_XD_DR>=to_date('2009-11-01 00:00:00 ','yyyy-mm-dd HH24:MI:SS')  
and DATE_XD_DR<to_date('2009-11-02 00:00:00 ','yyyy-mm-dd HH24:MI:SS');  
  • 1.
  • 2.
  • 3.

 

其实在to_date函数中只要前后的时间参数能够一对一对应好,分隔符只要Oracle表有的就都可以用,我做了几个测试:

 

to_date('2009/11/01 12:00:00 ','yyyy-mm-dd HH24:MI:SS')  
to_date('2009;11;01 12:00:00 ','yyyy-mm-dd HH24:MI:SS')  
to_date('2009,11/01 12:00:00 ','yyyy-mm-dd HH24:MI:SS')  
to_date('2009-11-01 12:00:00 ','yyyy-mm-dd HH24:MI:SS')  
to_date('2009/11-01 12:00:00 ','yyyy;mm-dd HH24:MI:SS')  
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.

 

等等都是可以的 。以上的相关内容就是对Oracle表的介绍,望你能有所收获。

【编辑推荐】

  1. Oracle通过其实际存储过程中返回相关数据集
  2. Oracle临时表用法的经验心得
  3. Oracle数据文件的特性介绍
  4. Oracle修改字段类型2种方案介绍
  5. 删除Oracle数据库中重复数据的实际操作方案
责任编辑:佚名 来源: 博客园
相关推荐

2010-04-13 14:00:00

Oracle inse

2010-04-15 14:18:30

Oracle创建

2010-05-06 09:19:03

Oracle表

2011-04-11 14:45:15

Oracle表系统时间

2010-04-16 17:35:39

Oracle进程

2010-04-12 09:36:29

Oacle merge

2010-04-12 17:00:37

Oracle索引聚簇表

2010-04-09 10:13:13

Oracle数据字典

2010-05-10 17:00:53

Oracle死锁进程

2010-04-19 10:23:05

Oracle内存结构

2010-04-30 11:29:19

Oracle Data

2010-04-20 13:17:44

2010-04-19 17:39:04

Oracle导入

2010-04-13 16:30:13

Oracle权限

2010-04-20 16:24:52

Oracle EM

2010-04-14 14:40:32

Oracle 10g

2010-04-16 11:11:46

Oracle存储过程

2010-05-05 14:55:15

Oracle存储过程

2010-04-29 12:23:58

Oracle 获取系统

2010-04-27 10:25:28

Oracle Subs
点赞
收藏

51CTO技术栈公众号