oracle小常识

一、oracle时间类型的处理

1、用sql语句把时间 2010-10-01 09:28:03插入oracle 的date类型字段

insert into 表名(字段名) values (to_date('2010-10-01 09:28:03','yyyy-mm-dd hh24:mi:ss'))

2、根据date类型字段查询

select * from 表名 where to_char(date类型字段,'yyyy-mm-dd') between '2012-03-06' and '2012-03-08'

二、delete from tablea & truncate table tablea的区别

  truncate 语句执行速度快,占资源少,并且只记录页删除的日志;

  delete 对每条记录的删除均需要记录日志

 

posted on 2012-03-08 09:13  Code changes life  阅读(241)  评论(0编辑  收藏  举报

导航