Chinaunix首页 | 论坛 | 博客
  • 博客访问: 600671
  • 博文数量: 30
  • 博客积分: 8020
  • 博客等级: 中将
  • 技术积分: 1125
  • 用 户 组: 普通用户
  • 注册时间: 2007-01-31 16:14
文章分类

全部博文(30)

文章存档

2011年(1)

2010年(3)

2009年(5)

2008年(21)

分类: Oracle

2008-11-08 11:55:22

-- drop table.

DROP TABLE T_TIMESTAMP;

-- create test table

CREATE TABLE T_TIMESTAMP (
no number(2) primary key,
st timestamp not null,
ed timestamp not null
);

-- insert data table

INSERT INTO T_TIMESTAMP VALUES(1,systimestamp,systimestamp+1);
INSERT INTO T_TIMESTAMP VALUES(2,systimestamp+1,systimestamp+2);
INSERT INTO T_TIMESTAMP VALUES(3,systimestamp+2,systimestamp+3);
INSERT INTO T_TIMESTAMP VALUES(4,systimestamp+3,systimestamp+4);

commit;

-- select current systimestamp > st and < ed;
--select * from t_timestamp where (systimestamp+1.5) > st and (systimestamp+1.5) < ed;
select * from t_timestamp where systimestamp>=st;

阅读(1458) | 评论(0) | 转发(0) |
0

上一篇:BAT 命令大全

下一篇:RHEL 4安装oracle10G

给主人留下些什么吧!~~