alter table tbmoudule drop column imouduleID; --删除列 mysql
select coalesce(col,0) ,value(col,'0') from tbl;--为null赋默认值 db2
alter table SJPT_SFSL add column flag int default 0
CREATE INDEX SJPT_SFSL_flag ON SJPT_SFSL(flag);
取得当前年月日:
SELECT current date FROM sysibm.sysdummy1
取得当前时分秒:
SELECT current time FROM sysibm.sysdummy1
取得当前年月日时分秒:
SELECT current timestamp FROM sysibm.sysdummy1
取得3个月前的日期
SELECT current date - 3 month FROM sysibm.sysdummy1
取得3天前的日期
SELECT current date - 3 day FROM sysibm.sysdummy1
call 存储过程名称();
alter session force parallel query parallel 4;ora并行处理就是为了将一个SQL语句分布到多个CPU上去执行
一亿条数据不算太大,如果你的表不是提供7*24联机服务,则可以参考如下步骤
1.CREATE TABLE NEW_TABLE PARALLEL X AS SELECT * FROM OLD_TABLE WHERE 1=2
2.ALTER TABLE NEW_TABLE NOLOGGING
3.
alter session force parallel ddl parallel x;
alter session force parallel dml parallel x;
alter session force parallel query parallel x;
insert /*+ append parallel(new_table,x) */ into new_table as
select xxx,nvl(a,-1),nvl(b,-1),nvl(c,-1),nvl(d,-1),xxx from old_table