摘要: 1 select * from A where A.name like 'TEST';上面的SQL 不能查出任何结果===>select * from A where A.name = 'TEST';2 SELECT * FROM BWHERE B.NAME not like 'b2';===========>无效限定符 应该修改为SELECT * FROM BWHERE B.NAME != 'b2'; 阅读全文
posted @ 2013-01-10 22:48 viviVIVIviviViVi 阅读(125) 评论(0) 推荐(0)
摘要: 1 截取字符串//lastIndexOf();http://www.w3school.com.cn/js/jsref_lastIndexOf.asp//substring();http://www.w3school.com.cn/js/jsref_substring.asp2 字符串中查找指定字符串search() http://www.w3school.com.cn/js/jsref_search.asp 阅读全文
posted @ 2013-01-08 03:30 viviVIVIviviViVi 阅读(1286) 评论(0) 推荐(0)
摘要: 1 截取字符串//lastIndexOf();http://www.w3school.com.cn/js/jsref_lastIndexOf.asp//substring();http://www.w3school.com.cn/js/jsref_substring.asp 2 查询指定字符串var str="Hello world!"document.write(str.search("H") + "<br />")document.write(str.search("World") + " 阅读全文
posted @ 2013-01-08 03:15 viviVIVIviviViVi 阅读(253) 评论(0) 推荐(0)
摘要: <html><head><script type="text/javascript" src="/jquery/jquery.js"></script><script type="text/javascript"> $(document).ready(function(){$("#selectTest").change(function(){//alert("Hello");//alert($("#selectTest&quo 阅读全文
posted @ 2013-01-06 02:14 viviVIVIviviViVi 阅读(182) 评论(0) 推荐(0)
摘要: TABLE CPROCEDUREcreate or replace procedure P_TEST_LOOP_CUR(in_test in varchar2) is /*************************************************************** *NAME : [Name] *PURPOSE : --更新表C的数据 添加bid外键数据 *IMPUT : --输入参数没意义 *UpdateDate : --函数更改信息(包括作者、时间、更改内容等) *************************************... 阅读全文
posted @ 2013-01-05 09:19 viviVIVIviviViVi 阅读(258) 评论(0) 推荐(0)
摘要: 重点关注9:用EXISTS替代IN.重点关注案例 :查找DEPT_1部门的人员姓名9.1 SQL语句--子查询select pname from t_person where deptid in ( select deptid from t_department where deptname like 'DEPT_1');--exsistselect pname from t_person where exists ( select * from t_department where t_department.deptid = t_person.deptid ... 阅读全文
posted @ 2013-01-04 01:15 viviVIVIviviViVi 阅读(192) 评论(0) 推荐(0)
摘要: 影响ORACLE效率的关键点 原文 http://hi.baidu.com/odbcconnection/item/f4a56cbf1c8bea422bebe32f 1:选择最有效率的表名顺序(只在基于规则的优化器中有效) ORACLE的解析器按照从右到左的顺序处理FROM子句中的表名,因此FROM子句中写在最后的表(基础表drivingtable)将被最先处理.在FROM子句中包含多个表的情况下,必须选择记录条数最少的表作为基础表.当ORACLE处理多个表时,会运用排序及合并的方式连接它们.首先,扫描第一个表(FROM子句中最后的那个表)并对记录进行派序,然后扫描第二个表(FROM子句中最. 阅读全文
posted @ 2013-01-04 01:15 viviVIVIviviViVi 阅读(637) 评论(0) 推荐(0)
摘要: exists (sql 返回结果集为真) notexists (sql 不返回结果集为真) 如下: 表A 表B 表A和表B是1对多的关系 A.ID => B.AID select a.id from A where exists (select a.id from b where a.id = b.aid);select a.id from Awhere not exists ( select a.id from b where a.id = b.aid );条件查询 select * from A where exists (select a.id ... 阅读全文
posted @ 2013-01-03 19:13 viviVIVIviviViVi 阅读(580) 评论(0) 推荐(0)
摘要: create or replace procedure P_CHANGE_FK_STATUS(IN_TABLE in varchar2,IN_TYPE IN VARCHAR2,IN_ACTION IN VARCHAR2) is--失效或者生效指定表的外键-- IN_table :表名-- IN_TYPE :必须为 R 代表外键-- IN_ACTION :DISABLE 或者 ENABLEV_TABLE VARCHAR2(30);V_ACTION VARCHAR2(10);V_SQL VARCHAR2(200) ;V_FK VARCHAR2(60); begin V_TABLE:... 阅读全文
posted @ 2013-01-03 17:00 viviVIVIviviViVi 阅读(573) 评论(0) 推荐(0)
摘要: 执行如下SQL 出现以下ERROR 1 create or replace procedure P_DISTABLE_FK(IN_TABLE in varchar2) is 2 --失效 输入表名称的外键 3 V_SQL VARCHAR2(200) ; 4 V_FK VARCHAR2(60); 5 begin 6 --查询外键名称 7 V_SQL :='SELECT * FROM USER_CONSTRAINTS WHERE CONSTRAINT_TYPE='|| 'R'|| ' and table_name='||IN_TABLE; 8 dbm 阅读全文
posted @ 2013-01-03 16:31 viviVIVIviviViVi 阅读(4455) 评论(0) 推荐(0)