当前位置:Gxlcms > 数据库问题 > Oracle批量插入有日期类型数据

Oracle批量插入有日期类型数据

时间:2021-07-01 10:21:17 帮助过:91人阅读

insert into t(id,date,name) 2 select level,trunc(current_timestamp)+level,zhangsan 3 from dual 4 connect by level<= add_months(trunc(current_timestamp),1)-trunc(current_timestamp)

add_months(time,months)

  Oracle的自带的日期函数,在time这个时间上增加或减少months个月

select add_months(current_timestamp,6) from dual
--在当前时间加上半年
select add_months(current_timestamp,-1) from dual
--在当前时间减去一个月

connect by 用法 http://blog.csdn.net/wang_yunj/article/details/51040029

Oracle批量插入有日期类型数据

标签:name   select   color   rtti   border   arch   str   art   amp   

人气教程排行