
数据库
文章平均质量分 55
ticojj
这个作者很懒,什么都没留下…
展开
-
学明写的传神的初始化数据的存储过程
declare cursor c_order_id is select a.row_id from te_cust_order_list a where nvl(a.del_flag,'0')='0' and nvl(a.arc_flag,'0')='0' and f_o_get_customer_info(a.cust_id,'5') in ('运营商','...原创 2011-10-21 17:42:26 · 96 阅读 · 0 评论 -
SQL的四种语言:DDL、DML、DCL、TCL
1. DDL(Data Definition Language)数据库定义语言statements are used to define the database structure or schema。用于定义数据库的三级结构,包括外模式、概念模式、内模式及其相互之间的映像,定义数据的完整性、安全控制等约束。DDL不需要commit。DDL的操作包含:CREATEALTE...原创 2014-12-08 15:45:25 · 159 阅读 · 0 评论 -
Exchange Table, Index Type. Partition Add , Drop
CREATE INDEX idx_maprg_pp_pnlty_u_4 ON tbl_maprg_pp_pnlty_u(cup_crd_no) local( partition idx_maprg_pp_pnlty_u_4_201208 ,partition idx_maprg_pp_pnlty_u_4_201404 ,partition idx_maprg_pp_pnl...原创 2014-10-22 18:06:54 · 143 阅读 · 0 评论 -
多表查询,很多很乱,不过很有用,挑着看吧
http://www.cnblogs.com/mchina/archive/2012/09/07/2651568.htmlOracle笔记(六) 多表查询 本次预计讲解的知识点1、 多表查询的操作、限制、笛卡尔积的问题;2、 统计函数及分组统计的操作;3、 子查询的操作,并且结合限定查询、数据排序、多表查询、统计查询一起完成各个复杂查询的操作;一...原创 2014-08-07 11:46:32 · 118 阅读 · 0 评论 -
where > group by > having , execute priority
having子句与where有相似之处但也有区别,都是设定条件的语句。在查询过程中聚合语句(sum,min,max,avg,count)要比having子句优先执行.而where子句在查询过程中执行优先级别优先于聚合语句(sum,min,max,avg,count)。简单说来:where子句:select sum(num) as rmb from order where id>10/...原创 2014-08-07 11:29:56 · 94 阅读 · 0 评论 -
substr in Oracle,PHP,Javascript
PHP - 函数:substr()若 start 为负数,则从字符串尾端算起。若可省略的参数 length 存在,但为负数,则表示取到倒数第 length 个字符。使用范例 <?echo substr("abcdef", 1, 3);...www.t086.com/code/php/... 2008-06-24 - 百度快照 - 评价oracle中怎...原创 2014-07-16 10:02:15 · 119 阅读 · 0 评论 -
SQL面试题之guoup,sum复杂用法
1 。SQL语句面试题关于group by 表内容: 2005-05-09 胜 2005-05-09 胜 2005-05-09 负 2005-05-09 负 2005-05-10 胜 2005-05-10 负 2005-05-10 负 如果要生成下列结果, 该如何写sql语句? 胜 负 2005-05-09 2 2 2005-05-10 1 2 --------------------------...原创 2014-06-24 14:28:07 · 184 阅读 · 0 评论 -
五十种巧妙优化SQL Server数据库的方法
---------------------丫的发现那么多人看了我的博客,没一个给评论的,难道你们的菊花都被棒子给堵住了? ------------------------------------ 查询速度慢的原因很多,常见如下几种: 没有索引或者没有用到索引(这是查询慢最常见的问题,是程序设计的缺陷)。 I/O吞吐量小,形成了瓶颈效应。 没有创建计...原创 2014-06-24 12:01:05 · 110 阅读 · 0 评论 -
Oracle优化原理
先说明一下,ORACLE有一个优化器(Optimizer),ORACLE的优化机理就是从Optimizer开始的。 明确两个概念:Optimizer 对ORACLE的优化方式有两种,一种是基于规则的,我们称为RBO(Rule-Based Optimization),一种是基于代价的CBO(Cost-Based Optimization),我们从字面就可基本理解这两个优化方式的含义,不错,R...原创 2014-06-24 10:40:08 · 100 阅读 · 0 评论 -
spool file
-----------genhccappl.sql--------------drop table tbl_maprg_inap_appl_tmp1 ;drop table tbl_maprg_inap_appl_tmp2 ;drop table tbl_maprg_inap_card_tmp1 ;drop table tbl_maprg_inap_card_tmp2 ;CREATE T...原创 2014-01-27 14:44:58 · 178 阅读 · 0 评论 -
masking function
create or replace FUNCTION stfn(varchar_input IN VARCHAR2, shifting_index IN NUMBER DEFAULT NULL)RETURN VARCHAR2IS varchar_output VARCHAR2(255); inchar_len NUMBER; temp_char CHAR; v_shifting_inde...原创 2014-01-27 14:39:45 · 215 阅读 · 0 评论 -
resource busy and acquire with nowait specified
ora-00054:resource busy and acquire with nowait specified解决方法当某个数据库用户在数据库中插入、更新、删除一个表的数据,或者增加一个表的主键时或者表的索引时,常常会出现ora-00054:resource busy and acquire with nowait specified这样的错误。主要是因为有事务正在执行(或者事务...原创 2014-05-29 14:47:57 · 114 阅读 · 0 评论 -
十道海量数据处理面试题与十个方法大总结
keep it here ,read later , I feel it looks strong.. and hard.. 第一部分、十道海量数据处理面试题 1、海量日志数据,提取出某日访问百度次数最多的那个IP。 此题,在我之前的一篇文章算法里头有所提到,当时给出的方案是:IP的数目还是有限的,最多2^32个,所以可以考虑使用hash将ip直接存入内存,然后进行统计...原创 2014-05-26 16:13:24 · 106 阅读 · 0 评论 -
DB2 数据库个人总结
本人刚使用DB2一小段时间,很多内容不断更新中1. 关于日期格式的转换,很离奇的是,不需要to_date什么的。只需要这样就可以 例子一: select * from bank_depart where t_crt_tm between '2012-2-13 00:00:00' and '2012-2-13 23:59:59' with ur;(笔者注:t_crt_tm ...原创 2012-02-13 14:44:48 · 121 阅读 · 0 评论 -
Oracle常用函数
1.ASCII返回与指定的字符对应的十进制数;3.CONCAT连接两个字符串;6.LENGTH返回字符串的长度;7.LOWER返回字符串,并将所有的字符小写8.UPPER返回字符串,并将所有的字符大写11.SUBSTR(string,start,count)12.REPLACE('string','s1','s2')14.TRIM('s' from 'string')41.SYSDATE用来得到...原创 2011-11-16 15:51:55 · 71 阅读 · 0 评论 -
jdbc优化,零碎
例如: For(int I = 0; I < 1000; ++I) { PreparedStatement ps = conn.prepareStatement("select a,b from t where c = " + I); ResultSet rs = Ps.executeQuery(); Rs.close(); Ps.close(); } 这里不会用到缓冲. 每次循...原创 2012-04-27 14:13:27 · 102 阅读 · 0 评论 -
sqlplus心得
[color=red]sqlplus $1/$2 @/tmp/EDOMASK/CDSTCK/MAPRG/drop_maprg_cd_s14_ins2014bk.sql[/color][b]一,登陆方式:[/b]1. C: >sqlplus username/password 如:普通用户登录 sqlplus scott/tigerC: >sqlplus username/p...原创 2014-12-08 18:23:25 · 173 阅读 · 0 评论