我有一个表字段是这样的
id number
f_date timestamp
status number (0或者1)我想要在f_date这个字段里面插入今后10年的所有日期 (差不多是365*10天)
有什么好办法吗?
id number
f_date timestamp
status number (0或者1)我想要在f_date这个字段里面插入今后10年的所有日期 (差不多是365*10天)
有什么好办法吗?
解决方案 »
- oracle 查询条件的截取
- 在windows2008server下imp数据,出现中断问题事件名称: APPCRASH
- 我有个sql,3个字符型的数值,求平均值。可是这3个数中如果有0,就得到空值?
- 服务器上同时装ORACLE服务器和客户端,SQL/PULS,P/LSQL,输入用户SCOTT和密码TIGER后,提示错误不能进入?求助100分!
- 谁能解答这个问题?超难
- 关于游标为空的问题
- 为何我的8i+win2000服务一旦停止然后再起就连不上了?
- oracle提示错误,请教高手!!!
- 利用取到的SQL的值当条件在获取值,拼成一个SQL 如何实现?
- C# 调用oracle 的时候错误
- oracle 中触发器的简单用法,谢谢
- 关于oracle pro*c
insert into t(id,f_date,status)
select level,trunc(current_timestamp)+level,0
from dual
connect by level <= months_between(trunc(current_timestamp),120)-trunc(current_timestamp);
SELECT SYSDATE+ROWNUM FROM DUAL CONNECT BY ROWNUM<4000
改成add_months就好了
select level,trunc(current_timestamp)+level,0
from dual
connect by level <= add_months(trunc(current_timestamp),120)-trunc(current_timestamp)
from dual
connect by level <= add_months(trunc(current_timestamp),120)-trunc(current_timestamp)
--current_timestamp取当前系统时间戳
--trunc(current_timestamp)取到当天零时
--connect by 递归调用
--level递归的层
--add_months日期函数,加n个月后是哪天
就是想写 add_months 的,手误。。