
Oracle
ibenben.org
喜欢编程的管理人员...
展开
-
oracle表数据误删还原
首先,找到数据删除前的一个时间点。select timestamp_to_scn(to_timestamp('2013-10-12 8:30:00', 'YYYY-MM-DD HH24:MI:SS')) from dual;如,我这里得到的点为36551273744。然后根据这个点找到你所删除文件的表的数据。使用一个临时表把这些数据存放起来。create t原创 2013-10-12 16:29:19 · 1473 阅读 · 0 评论 -
Oracle判断值为非数字
select * from product_info t where t.contract_detailid is not nulland length(translate(t.contract_detailid,'-.0123456789'||t.contract_detailid,'-.0123456789'))原创 2014-09-30 14:20:46 · 5926 阅读 · 0 评论 -
SQL存在一个表而不在另一个表中的数据
select a.id,a.oacode,a.custid,a.custname,a.xsz,a.salename,a.communicationtheme,a.communicationproperty,a.communicationtime,a.productmanager,'' creator,a.creator oaCreator,a.createdate,case when a.oast原创 2014-08-22 16:40:30 · 1848 阅读 · 0 评论 -
ORACLE union order by
select * from (select a.id,a.oacode,a.custid,a.custname,a.xsz,a.salename,a.communicationtheme,a.communicationproperty,a.communicationtime,a.productmanager,a.creator,a.createdate from technology_flow原创 2014-06-18 11:36:33 · 1177 阅读 · 0 评论 -
ORACLE 按表字段值的不同统计数量
select p.id comperitorId,p.compcorp competitorName,sum(case when c.kindname = 'ATM' then c.num else 0 end) atm,sum(case when c.kindname = 'CRS' then c.num else 0 end) crs,sum(case when c.kindname原创 2014-05-29 16:50:16 · 9564 阅读 · 0 评论 -
ORACLE uuid自动生成主键
-- Create tablecreate table TECHNOLOGYCOMPANY( ID VARCHAR2(32) default SYS_GUID() not null, FLOWID VARCHAR2(50), CONPANYID NUMBER, ISCOMMUNICATION VARCHAR2(10))原创 2014-05-07 14:23:58 · 8001 阅读 · 0 评论 -
ORACLE A表根据B表字段更新
update product_info t set (t.salename,t.xsqy)=(select c.salename,c.xsqy from contract_erp c where c.contractcode=t.contractid)where t.contractid in(select c.contractcode from contract_erp c) and t.co原创 2014-04-16 10:15:19 · 6465 阅读 · 1 评论 -
ORACLE sql 根据in查询里面数据的顺序进行排序
select rownum||'' as id,t.materialname as prodCode,t.ename as prodName,t.materialtype||'_'||t.groupcode as kindName,t.unit as unit,'' as spec,'' as price,t.materialcode as remark from material_mast原创 2014-02-12 16:33:33 · 5349 阅读 · 0 评论 -
Oracle数据库imp命令导入时1659错误处理
今儿在自己电脑上搭建开发环境,在给数据库导入表结构以及数据时报1659错误,错误内容如下:IMP-00017: 由于 ORACLE 错误 1659, 以下语句失败: "CREATE TABLE "T_DATA_KKCL"…………IMP-00003: 遇到 ORACLE 错误 1659ORA-01659: 无法分配超出 6 的 MINEXTENTS (在表空转载 2013-10-22 13:53:51 · 3260 阅读 · 0 评论 -
oracle 执行计划
1、设置计划explain plan for select * from ( select * from dun_search_view where 1=1 and (( salename='陈永智' and xsqy='广州办事处') or (','||fzuserid||',' like '%,6839951,%')) ) where rownum <= 30;2原创 2015-03-03 13:25:56 · 984 阅读 · 0 评论