DB2 转Oracle 
	
    
    
	 DB2 转Oracle 
某天是星期几的函数
DB2: 
select a.yyxe,a.zblb,a.ysdm,a.daynum,b.zjxm  from zy_yspb a ,zy_zjlb b where a.ysdm=b.id and  a.ksdm=10000 order by abs( a.daynum -DAYOFWEEK(current   date)+1) desc,a.daynum,a.zblb
sql.executeQuery:ORA-00936: 缺失表达式
Oracle :
select a.yyxe,a.zblb,a.ysdm,a.daynum,b.zjxm  from zy_yspb a ,zy_zjlb b where a.ysdm=b.id and  a.ksdm=10000 order by abs( a.daynum -to_char(sysdate,'D')+1) desc,a.daynum,a.zblb
to_char 和to_date的用法
DB2: 
select count(*) as yyrs from zy_zzd where zblb=2 and zzys=10000 and zzrq >='2009-08-21 00:00:00' and zzrq <='2009-08-21 23:59:59' and -DAYOFWEEK(current   date)-1=2
Oracle :
select count(*) as yyrs from zy_zzd where zblb=2 and zzys=10000 and zzrq >=to_date('2009-08-21 00:00:00','yyyy-mm-dd hh24:mi:ss')  and zzrq <=to_date('2009-08-21 23:59:59','yyyy-mm-dd hh24:mi:ss') and to_char(zzrq,'D')-1=2
ZCJGMC,ZRJGMC,SHYSMC,ZRKSMC,CARDID,ZCKSMC
    
     
	
	
    
    
	相关文档:
        
    
    1.创建表空间
  create tablespace test datafile'c:\test.dbf' size 10m;  //名字不要为数字
2.创建用户
create user userName identified by password;  //不要为数字
3.给用户授权
grant dba to userName; --授予DBA权限
grant unlimited tablespace to userName;--授予不限制的表空间
grant sele ......
	
    
        
    
    Oracle 向一个表中插入数据的两种方式:
       Conventional Insert Operations:传统插入会优先使用高水位之下,会保证数据应用完整性:高水位之下是指:删除之后的剩余空间,高水位之上是指:从来没有用过的处女块。
       Direct-path Insert Operatio ......
	
    
        
    
    
-- 笔记中部分内容
SQL> create table tt2 as select * from employee;
Table created.
SQL> drop table tt2;
Table dropped.
SQL> select * from tt2; 
select * from tt2
*
ERROR at line 1:
ORA-00942: table or view does not exist
SQL> flashback table tt2 to before drop;
Flashback comp ......
	
    
        
    
    http://www.51testing.com/?uid-16403-action-viewspace-itemid-101604
 统计信息包括下面几类:
 
表统计:包括记录数、block数和记录平均长度。
列统计:列中不同值的数量(NVD)、空值的数量和数据分布(HISTOGRAM)。
索引统计:索引叶块的数量、索引的层数和聚集因子(CLUSTERING FACTOR)。
系统统计 ......