SELECT name,text from sysobjects o,syscomments s where o.id=s.id and text LIKE '%text%' and o.xtype='p'
分类:
数据库 时间:
2015-06-26 23:33:35
阅读次数:
165
转自:http://www.dzwebs.net/2418.html 我们先来看看这个语句的结果:select * from table where 1=1,其中where 1=1,由于1=1永远是成立的,返回TRUE,条件为真;所以,这条语句,就相当于select * from table,返回....
分类:
其他好文 时间:
2015-06-26 22:23:35
阅读次数:
202
oracle 优化or 更换in、exists、union几个字眼。测试没有问题!根据实际情况选择相应的语句是。假设指数,or全表扫描,in 和not in 应慎用。否则会导致全表扫描。select * from T_Pro_Product where bar_code = 'nnnmmm'...
分类:
数据库 时间:
2015-06-26 14:47:57
阅读次数:
147
oracle 性能优化建议小结原则一:注意WHERE子句中的连接顺序:ORACLE采用自下而上的顺序解析WHERE子句,根据这个原理,表之间的连接必须写在其他WHERE条件之前, 那些可以过滤掉最大数量记录的条件必须写在WHERE子句的末尾.尤其是“主键ID=?”这样的条件。原则二: SELECT子...
分类:
数据库 时间:
2015-06-26 12:18:35
阅读次数:
181
--1、查看表空间的名称及大小 SELECT t.tablespace_name, round(SUM(bytes / (1024 * 1024)), 0) ts_size FROM dba_tablespaces t, dba_data_files d WHERE t.tablespace_nam...
分类:
数据库 时间:
2015-06-26 10:48:27
阅读次数:
212
oracle使用虚列rownum可以查询到指定数字之间的记录数。 第一行的rownum=1 比如我们想查询前五条记录,可以使用 select * from 表名 where rownum5时,就会出错,这时候就得换种方法了。 select 列名 from (select rownum r,列名 fr...
分类:
数据库 时间:
2015-06-26 10:43:05
阅读次数:
203
公司的11g的dataguard主备不同步,检查步骤如下:Primary:查询主库的最大日志 SQL> select max(sequence#) from v$archived_log;SQL> select max(sequence#) from v$archived_log where ap....
分类:
其他好文 时间:
2015-06-26 10:40:47
阅读次数:
343
1、子查询更新update kapage_news b set sharecount=(select COUNT(*) FROM kasharing a where a.srcid=b.newsid);View Code
分类:
数据库 时间:
2015-06-26 08:02:18
阅读次数:
135
Problem Description:Given a sorted integer array where the range of elements are [lower,upper] inclusive, return its missing ranges.For example, given...
分类:
其他好文 时间:
2015-06-26 00:25:56
阅读次数:
137
-----正常执行计划
set autotrace traceonly
set linesize 1000
select /*+index(t idx_object_id)*/ * from t where object_id=19;
Execution Plan
----------------------------------------------------------...
分类:
数据库 时间:
2015-06-25 23:06:32
阅读次数:
433