sql server case vs decode,转的
Oracle:select decode(a1,'0', 'easy', '1', 'normal', '2', 'hard') level from a;转成SQL Server为:select (case a1 when '0' then 'easy'when '1' then 'normal'when '2' then 'hard' end) levelfrom a[@more@]
oracle 执行动态SQL的另外一个妙招,execute immediate 的旧版本替代
让我们看看老版本的oracle 是怎么执行动态SQL的create or replace procedure scheam1.trunc*** as source_cursor integer; rows_processed integer; native constant integer := 1; begin source_cursor := dbms_sql.open_cursor; dbms_sql.parse(source_cursor, 'truncate table ****** reuse storage', native); rows_processed := dbms_sql.execute(source_cursor); commit; dbms_sql.close_cursor(source_cursor);exception when others then
normal format
关系数据库设计之基本规则--范式 引用:原帖由 xzh2002 于 2003-7-22 10:56 发表 1NF: 属性不可再分 2NF:消除1NF的部分依赖 3NF:消除2NF的传递依赖 引用: [color=green] 构造数据库必须遵循一定的规则。在关系数据库中,这种规则就是范式。范式是符合某一种级别的关系模式的集合。关系数据库中的关系必须满足一定的要求,即满足不同的范式。目前关系数据库有六种范式:第一范式(1NF)、第二范式(2NF)、第三范式(3NF)、第四范式(4NF)、第五范式(5NF)和第六范式(6NF)。满足最低要求的范式是第一范式(1NF)。在第一范式的
Solaris下修改主机名
Solaris下修改主机名 /etc/hosts/etc/nodename/etc/hostname.ce0/etc/net/ticlts/hosts/etc/net/ticots/hosts/etc/net/ticotsord/hosts按照文件中格式将原始主机名替换为新的主机名就可以了。[@more@]
更快地批量数据处理 by ace yangtingkun
如何更快地批量数据处理?发表人:xzh2000 | 发表时间: 2006年十二月07日, 16:42在批量处理数据时,比如从上亿条记录的表中删除上1000万条数据,不仅要考虑对undo的影响,还要考虑对redo,对磁盘i/o,锁、阻塞等的影响,在某种意思上讲,同样的任务,执行的sql次越少,总的消耗的时间就越少。。。create table tmp_object1 as select * from dba_objects;create index idx_object1_name on tmp_object1(object_name);create table tmp_object2 as select * from dba_objects;alter session set events '10046 trace name context forever, l
In VS exists, in achived by rewirte sql, existis rewrite using pl/sql block
Tom: can you give me some example at which situation IN is better than exist, and vice versa. and we said...Well, the two are processed very very differently. Select * from T1 where x in ( select y from T2 ) is typically processed as: select * from t1, ( select distinct y from t2 ) t2 where t1.x = t2.y; The subquery is evaluated, distinct'ed, indexed (or hashed or sorted) and then joined to the original table -- typically. As opposed to select * from t1 where exi