
plsql
文章平均质量分 51
Mr_LH_525
一个中年小白。
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
合并merge into
语法: merge into t1 using t2 on(t1.c1=t2.c3) when matched then update/delete/.. set t1.c2=t2.c4 when not matched then insert(c1,c2) values(t2.c3,t2.c4); 要点: 1.语句merge into t1 只能更改t1的数据 2.updat原创 2015-08-14 10:36:07 · 627 阅读 · 0 评论 -
删除oracle表中名称重复的记录
介绍三种方法: 1.建立组合索引 create index idx_name_id on table(name,id); delete from table a where exists(select null from table b where b.name=a.name原创 2015-08-20 16:00:17 · 678 阅读 · 0 评论 -
oracle常见报错总结
ORA-00028:您的回话已被删除 oracle请求服务过长,导致数据传输中断 ORA-00932:不一致的数据类型,要求得到的却是blob blob字段不许distinct,insert,update等操作,他是特殊的对象,其实数据库里记录的只是一个类似指针的对象,就像一个试图的概念 ORA-01427:单原创 2015-08-20 16:49:37 · 703 阅读 · 0 评论 -
将字符和数字分离
1.可以使用正则表达式: select regexp_replace(a,'[0-9]',' ') d, regexp_replace(a,'[^0-9]',' ') e from table; 注:[0-9]一种表示方式,代表[0123456789],还可以写成[[:digit:]];"^"表示否定 2.原创 2015-08-21 15:43:00 · 1407 阅读 · 0 评论 -
从字符串中删除不需要的字符
比如删除‘abc’,三种方法 1.select str1,replace(translate(str1,'abc','eee'),'e'.' ') str from table; 2.select str1,translate(str1,'1abc','1') str from table; 3.使用更简单的正则函数regexp_replace,直接把[]内列举的字符替换为空原创 2015-08-21 10:52:48 · 611 阅读 · 0 评论 -
oracle中的正则表达式
1.regexp_replace 相当于同时执行了多个replace()函数; 实例在前面的文章中已经有了介绍 2.regexp_like 比如查询只包含字母或数字型的数据 select a from v where regexp_like(a,'^[0-9a-zA-Z]+$'); 注:"$"该符号在方括号外,表示字符串的结束。 regexp_like对应普通的原创 2015-08-21 16:04:44 · 872 阅读 · 0 评论 -
表空间的一些知识
1.创建表空间 create tablespace xxx datafile 'd:\...\book.dbf' size 32M autoextend on next 10M maxsize 1000M; 注:表空间一般放置位置D:\app\qianx\oradata\orcl 2.设置默认表空间 alter database default tablespace xxx; comm原创 2015-12-23 14:36:52 · 478 阅读 · 0 评论 -
oracle去重
1.oracle查找表中的重复数据 select testid,count(1) from table group by testid having count(1)>1; testid 标签号 2.去重 detele from tab_name a where col1,col2 in(原创 2015-08-20 16:37:32 · 827 阅读 · 0 评论