随笔分类 - Oracle
摘要:select t.table_name,t.num_rows from user_tables t ORDER BY NUM_ROWS DESC;//实际行数 analyze table emp compute statistics; select num_rows * avg_row_len fr
阅读全文
摘要:--cmd 启动oracle数据库 sqlplus /nolog --链接conn / as sysdba; --删除本地文件 表空间 --drop tablespace sjbook_data including contents and datafiles;--drop tablespace s
阅读全文
摘要:SELECT wm_concat(GZTYPE) str FROM TB_FDN_WORKKIND
阅读全文
摘要:Oracle PL/SQL编程之八: 把触发器说透 本篇主要内容如下: 8.1 触发器类型 8.1.1 DML触发器 8.1.2 替代触发器 8.1.3 系统触发器 8.2 创建触发器 8.2.1 触发器触发次序 8.2.2 创建DML触发器 8.2.3 创建替代(INSTEAD OF)触发器 8.
阅读全文
摘要:有一个表名为tb,字段段名为name,数据类型nchar(20)。 1、假设字段数据为空,则不管改为什么字段类型,可以直接执行: alter table tb modify (name nvarchar2(20)); 2、假设字段有数据,则改为nvarchar2(20)可以直接执行: alter t
阅读全文
摘要:create or replace PROCEDURE Pro_fdn_costuser (v_BZBM in tb_if_archives.BZBM%type,v_BZMC in tb_if_archives.BZMC%type,v_CJBM in tb_if_archives.CJBM%type
阅读全文
摘要:declare v_cnt number; V_SQL VARCHAR2 (500) := '';begin select count(*) into v_cnt from dual where exists(SELECT * FROM USER_TAB_COLUMNS WHERE TABLE_NA
阅读全文
摘要:ceil和floor函数在一些业务数据的时候,有时还是很有用的。 ceil(n) 取大于等于数值n的最小整数; floor(n)取小于等于数值n的最大整数 如下例子 SQL> select ceil(9.5) from dual; CEIL(9.5) 10 SQL> select floor(9.5
阅读全文
摘要:update tb_fdn_deviceaccount set czMC =replace(czMC,'站','') where zdmc in ('大连站','沈阳北站');delete from tb_fdn_deviceaccount where zdmc is null;update tb_
阅读全文
摘要:--编号declare v_cnt number; V_SQL VARCHAR2 (500) := '';begin select count(*) into v_cnt from dual where exists(SELECT * FROM USER_TAB_COLUMNS WHERE TABL
阅读全文
摘要:declare v_cnt number; V_SQL VARCHAR2 (500) := '';begin select count(*) into v_cnt from dual where exists(SELECT * FROM user_tables WHERE TABLE_NAME =
阅读全文
摘要:SELECT w.ZDBH,w.HEATINGANDAIRCONDITIONERID, w.ZDMC, w.CZBH, w.CZMC, w.CNXS, w.ND, w.KTJF, w.KTJFMJ, w.KTZY, w.KTCS, w.KTJ, h.hMJ HCOUNT, a.hmj KCOUNTF
阅读全文
摘要:select train_code,count(1) from tb_ask_trainbodyroadtrain group by train_code having count(1) >1
阅读全文

浙公网安备 33010602011771号