
数据库
文章平均质量分 80
iteye_9849
这个作者很懒,什么都没留下…
展开
-
sql相关
两种表复制语句: eg: select * into destTbl from srcTbl 注:destTbl 表可不存在,运行是自动创建insert into destTbl(fld1, fld2) select fld1, 5 from srcTbl 注:5是常量,不是来自表中的字段 .destTbl表要存在 oracle 查询:http://www.iteye.com/to...2009-10-30 09:44:41 · 112 阅读 · 0 评论 -
DB 常用
NVL(expr1,expr2) 如果expr1是NULL,则返回expr2,否则返回expr1.返回值与expr1类型相同,除非expr1是字符串类,在这种情况下将返回VARCHAR2类型.这个函数用于确保查询记录集中不包含NULL值. 类似的还有 NVL(expr1,expr2,expr3) 如果expr1是NULL,则返回expr2,否则返回expr3.返回值与expr2类型相同,除非exp...原创 2010-09-29 22:51:58 · 129 阅读 · 0 评论 -
优化注意方面
1.对查询进行优化,应尽量避免全表扫描,首先应考虑在 where 及 order by 涉及的列上建立索引。 2.应尽量避免在 where 子句中对字段进行 null 值判断,否则将导致引擎放弃使用索引而进行全表扫描,如: select id from t where num is null 可以在num上设置默认值0,确保表中num列没有null值,然后这样查询: selec...原创 2009-09-08 10:17:46 · 111 阅读 · 0 评论